mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(image-preview):fix image-preview README、supplement teleport (#11429)
Co-authored-by: xuwenqiang <xuwenqiang@kanzhun.com>
This commit is contained in:
parent
9b00eb271c
commit
53ec8a91a1
@ -8,6 +8,7 @@ import {
|
|||||||
type PropType,
|
type PropType,
|
||||||
type CSSProperties,
|
type CSSProperties,
|
||||||
type ExtractPropTypes,
|
type ExtractPropTypes,
|
||||||
|
type TeleportProps,
|
||||||
} from 'vue';
|
} from 'vue';
|
||||||
|
|
||||||
// Utils
|
// Utils
|
||||||
@ -46,6 +47,7 @@ const popupProps = [
|
|||||||
'transition',
|
'transition',
|
||||||
'overlayStyle',
|
'overlayStyle',
|
||||||
'closeOnPopstate',
|
'closeOnPopstate',
|
||||||
|
'teleport'
|
||||||
] as const;
|
] as const;
|
||||||
|
|
||||||
export const imagePreviewProps = {
|
export const imagePreviewProps = {
|
||||||
@ -68,6 +70,7 @@ export const imagePreviewProps = {
|
|||||||
showIndicators: Boolean,
|
showIndicators: Boolean,
|
||||||
closeOnPopstate: truthProp,
|
closeOnPopstate: truthProp,
|
||||||
closeIconPosition: makeStringProp<PopupCloseIconPosition>('top-right'),
|
closeIconPosition: makeStringProp<PopupCloseIconPosition>('top-right'),
|
||||||
|
teleport: [String, Object] as PropType<TeleportProps['to']>,
|
||||||
};
|
};
|
||||||
|
|
||||||
export type ImagePreviewProps = ExtractPropTypes<typeof imagePreviewProps>;
|
export type ImagePreviewProps = ExtractPropTypes<typeof imagePreviewProps>;
|
||||||
|
@ -109,7 +109,7 @@ setTimeout(() => {
|
|||||||
|
|
||||||
```html
|
```html
|
||||||
<van-image-preview v-model:show="show" :images="images" @change="onChange">
|
<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>
|
</van-image-preview>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -120,7 +120,7 @@ setTimeout(() => {
|
|||||||
|
|
||||||
```html
|
```html
|
||||||
<van-image-preview v-model:show="show" :images="images" @change="onChange">
|
<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>
|
</van-image-preview>
|
||||||
```
|
```
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user