mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
feat(ImagePreview): passing current index to index slot (#7552)
This commit is contained in:
parent
24e8e82f34
commit
29dbd66c80
@ -140,7 +140,7 @@ export default createComponent({
|
|||||||
if (this.showIndex) {
|
if (this.showIndex) {
|
||||||
return (
|
return (
|
||||||
<div class={bem('index')}>
|
<div class={bem('index')}>
|
||||||
{this.slots('index') ||
|
{this.slots('index', { index: this.active }) ||
|
||||||
`${this.active + 1} / ${this.images.length}`}
|
`${this.active + 1} / ${this.images.length}`}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
|
@ -163,10 +163,10 @@ export default {
|
|||||||
|
|
||||||
### Slots
|
### Slots
|
||||||
|
|
||||||
| Name | Description |
|
| Name | Description | SlotProps |
|
||||||
| ----- | -------------------------------------------- |
|
| --- | --- | --- |
|
||||||
| index | Custom index |
|
| index | Custom index | { index: index of current image } |
|
||||||
| cover | Custom content that covers the image preview |
|
| cover | Custom content that covers the image preview | - |
|
||||||
|
|
||||||
### onClose Parematers
|
### onClose Parematers
|
||||||
|
|
||||||
|
@ -205,10 +205,10 @@ export default {
|
|||||||
|
|
||||||
通过组件调用 `ImagePreview` 时,支持以下插槽:
|
通过组件调用 `ImagePreview` 时,支持以下插槽:
|
||||||
|
|
||||||
| 名称 | 说明 |
|
| 名称 | 说明 | 参数 |
|
||||||
| ----- | ------------------------------ |
|
| ----- | ------------------------------ | ------------------------- |
|
||||||
| index | 自定义页码内容 |
|
| index | 自定义页码内容 | { index: 当前图片的索引 } |
|
||||||
| cover | 自定义覆盖在图片预览上方的内容 |
|
| cover | 自定义覆盖在图片预览上方的内容 | - |
|
||||||
|
|
||||||
### onClose 回调参数
|
### onClose 回调参数
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user