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">
|
<transition name="van-fade">
|
||||||
<div
|
<div
|
||||||
v-if="value"
|
v-if="value"
|
||||||
:class="b()"
|
:class="[b(), className]"
|
||||||
@touchstart="onWrapperTouchStart"
|
@touchstart="onWrapperTouchStart"
|
||||||
@touchend="onWrapperTouchEnd"
|
@touchend="onWrapperTouchEnd"
|
||||||
@touchcancel="onWrapperTouchEnd"
|
@touchcancel="onWrapperTouchEnd"
|
||||||
@ -75,6 +75,7 @@ export default create({
|
|||||||
asyncClose: Boolean,
|
asyncClose: Boolean,
|
||||||
startPosition: Number,
|
startPosition: Number,
|
||||||
showIndicators: Boolean,
|
showIndicators: Boolean,
|
||||||
|
className: [String, Object, Array],
|
||||||
loop: {
|
loop: {
|
||||||
type: Boolean,
|
type: Boolean,
|
||||||
default: true
|
default: true
|
||||||
|
@ -59,6 +59,7 @@ setTimeout(() => {
|
|||||||
| loop | Whether to enable loop | `Boolean` | `true` |
|
| loop | Whether to enable loop | `Boolean` | `true` |
|
||||||
| onClose | Close callback | `Function` | - |
|
| onClose | Close callback | `Function` | - |
|
||||||
| asyncClose | Whether to enable async close | `Boolean` | `false` |
|
| asyncClose | Whether to enable async close | `Boolean` | `false` |
|
||||||
|
| className | Custom className | `String | Array | Object` | - |
|
||||||
|
|
||||||
### onClose Parematers
|
### onClose Parematers
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@ const defaultConfig = {
|
|||||||
images: [],
|
images: [],
|
||||||
loop: true,
|
loop: true,
|
||||||
value: true,
|
value: true,
|
||||||
|
className: '',
|
||||||
showIndex: true,
|
showIndex: true,
|
||||||
asyncClose: false,
|
asyncClose: false,
|
||||||
startPosition: 0,
|
startPosition: 0,
|
||||||
|
@ -67,6 +67,7 @@ setTimeout(() => {
|
|||||||
| loop | 是否开启循环播放 | `Boolean` | `true` | 1.4.4 |
|
| loop | 是否开启循环播放 | `Boolean` | `true` | 1.4.4 |
|
||||||
| onClose | 关闭时的回调函数 | `Function` | - | 1.1.16 |
|
| onClose | 关闭时的回调函数 | `Function` | - | 1.1.16 |
|
||||||
| asyncClose | 是否开启异步关闭 | `Boolean` | `false` | 1.4.8 |
|
| asyncClose | 是否开启异步关闭 | `Boolean` | `false` | 1.4.8 |
|
||||||
|
| className | 自定义类名 | `String | Array | Object` | - | 1.5.2 |
|
||||||
|
|
||||||
### onClose 回调参数
|
### onClose 回调参数
|
||||||
|
|
||||||
|
2
types/dialog.d.ts
vendored
2
types/dialog.d.ts
vendored
@ -5,7 +5,7 @@ export type DialogOptions = {
|
|||||||
title?: string;
|
title?: string;
|
||||||
message?: string;
|
message?: string;
|
||||||
overlay?: boolean;
|
overlay?: boolean;
|
||||||
className?: string;
|
className?: any;
|
||||||
lockScroll?: boolean;
|
lockScroll?: boolean;
|
||||||
messageAlign?: string;
|
messageAlign?: string;
|
||||||
confirmButtonText?: 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';
|
import { VanPopupMixin } from './mixins/popup';
|
||||||
|
|
||||||
export type ImagePreviewOptions = string[] | {
|
export type ImagePreviewOptions = string[] | {
|
||||||
|
loop?: boolean;
|
||||||
images: string[];
|
images: string[];
|
||||||
|
className?: any;
|
||||||
startPosition?: number;
|
startPosition?: number;
|
||||||
showIndex?: boolean;
|
showIndex?: boolean;
|
||||||
|
asyncClose?: boolean;
|
||||||
showIndicators?: boolean;
|
showIndicators?: boolean;
|
||||||
onClose?: () => any;
|
onClose?: () => any;
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user