fix(image-preview):fix image-preview README、supplement teleport (#11429)

Co-authored-by: xuwenqiang <xuwenqiang@kanzhun.com>
This commit is contained in:
MrXwq
2022-12-28 18:23:28 +08:00
committed by GitHub
parent 9b00eb271c
commit 53ec8a91a1
3 changed files with 5 additions and 2 deletions
@@ -8,6 +8,7 @@ import {
type PropType,
type CSSProperties,
type ExtractPropTypes,
type TeleportProps,
} from 'vue';
// Utils
@@ -46,6 +47,7 @@ const popupProps = [
'transition',
'overlayStyle',
'closeOnPopstate',
'teleport'
] as const;
export const imagePreviewProps = {
@@ -68,6 +70,7 @@ export const imagePreviewProps = {
showIndicators: Boolean,
closeOnPopstate: truthProp,
closeIconPosition: makeStringProp<PopupCloseIconPosition>('top-right'),
teleport: [String, Object] as PropType<TeleportProps['to']>,
};
export type ImagePreviewProps = ExtractPropTypes<typeof imagePreviewProps>;
+1 -1
View File
@@ -109,7 +109,7 @@ setTimeout(() => {
```html
<van-image-preview v-model:show="show" :images="images" @change="onChange">
<template v-slot:index>Page: {{ index }}</template>
<template v-slot:index>Page: {{ index + 1 }}</template>
</van-image-preview>
```
@@ -120,7 +120,7 @@ setTimeout(() => {
```html
<van-image-preview v-model:show="show" :images="images" @change="onChange">
<template v-slot:index>第{{ index }}页</template>
<template v-slot:index>第{{ index + 1 }}页</template>
</van-image-preview>
```