mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
[new feature] ImagePreview: add className prop (#2433)
This commit is contained in:
parent
fad49ea1c7
commit
5c3388c8a9
@ -2,7 +2,7 @@
|
||||
<transition name="van-fade">
|
||||
<div
|
||||
v-if="value"
|
||||
:class="b()"
|
||||
:class="[b(), className]"
|
||||
@touchstart="onWrapperTouchStart"
|
||||
@touchend="onWrapperTouchEnd"
|
||||
@touchcancel="onWrapperTouchEnd"
|
||||
@ -75,6 +75,7 @@ export default create({
|
||||
asyncClose: Boolean,
|
||||
startPosition: Number,
|
||||
showIndicators: Boolean,
|
||||
className: [String, Object, Array],
|
||||
loop: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
|
@ -59,6 +59,7 @@ setTimeout(() => {
|
||||
| loop | Whether to enable loop | `Boolean` | `true` |
|
||||
| onClose | Close callback | `Function` | - |
|
||||
| asyncClose | Whether to enable async close | `Boolean` | `false` |
|
||||
| className | Custom className | `String | Array | Object` | - |
|
||||
|
||||
### onClose Parematers
|
||||
|
||||
|
@ -8,6 +8,7 @@ const defaultConfig = {
|
||||
images: [],
|
||||
loop: true,
|
||||
value: true,
|
||||
className: '',
|
||||
showIndex: true,
|
||||
asyncClose: false,
|
||||
startPosition: 0,
|
||||
|
@ -67,6 +67,7 @@ setTimeout(() => {
|
||||
| loop | 是否开启循环播放 | `Boolean` | `true` | 1.4.4 |
|
||||
| onClose | 关闭时的回调函数 | `Function` | - | 1.1.16 |
|
||||
| asyncClose | 是否开启异步关闭 | `Boolean` | `false` | 1.4.8 |
|
||||
| className | 自定义类名 | `String | Array | Object` | - | 1.5.2 |
|
||||
|
||||
### onClose 回调参数
|
||||
|
||||
|
2
types/dialog.d.ts
vendored
2
types/dialog.d.ts
vendored
@ -5,7 +5,7 @@ export type DialogOptions = {
|
||||
title?: string;
|
||||
message?: string;
|
||||
overlay?: boolean;
|
||||
className?: string;
|
||||
className?: any;
|
||||
lockScroll?: boolean;
|
||||
messageAlign?: string;
|
||||
confirmButtonText?: string;
|
||||
|
3
types/image-preview.d.ts
vendored
3
types/image-preview.d.ts
vendored
@ -1,9 +1,12 @@
|
||||
import { VanPopupMixin } from './mixins/popup';
|
||||
|
||||
export type ImagePreviewOptions = string[] | {
|
||||
loop?: boolean;
|
||||
images: string[];
|
||||
className?: any;
|
||||
startPosition?: number;
|
||||
showIndex?: boolean;
|
||||
asyncClose?: boolean;
|
||||
showIndicators?: boolean;
|
||||
onClose?: () => any;
|
||||
};
|
||||
|
Loading…
x
Reference in New Issue
Block a user