mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
[improvement] ImagePreview: add loop prop (#2103)
This commit is contained in:
parent
10f0604ad0
commit
0dbf1c5ee2
@ -14,6 +14,7 @@
|
||||
</div>
|
||||
<swipe
|
||||
ref="swipe"
|
||||
:loop="loop"
|
||||
:initial-swipe="startPosition"
|
||||
:show-indicators="showIndicators"
|
||||
@change="onChange"
|
||||
@ -63,6 +64,10 @@ export default create({
|
||||
type: Array,
|
||||
default: () => []
|
||||
},
|
||||
loop: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
startPosition: {
|
||||
type: Number,
|
||||
default: 0
|
||||
|
@ -53,4 +53,5 @@ setTimeout(() => {
|
||||
| startPosition | Start position | `Number` | `0` |
|
||||
| showIndex | Whether to show index | `Boolean` | `true` |
|
||||
| showIndicators | Whether to show indicators | `Boolean` | `false` |
|
||||
| loop | Whether to enable loop | `Boolean` | `true` |
|
||||
| onClose | Close callback | `Function` | - |
|
||||
|
@ -5,11 +5,12 @@ import { isServer } from '../utils';
|
||||
let instance;
|
||||
|
||||
const defaultConfig = {
|
||||
value: true,
|
||||
images: [],
|
||||
loop: true,
|
||||
value: true,
|
||||
showIndex: true,
|
||||
showIndicators: false,
|
||||
startPosition: 0
|
||||
startPosition: 0,
|
||||
showIndicators: false
|
||||
};
|
||||
|
||||
const initInstance = () => {
|
||||
|
@ -61,4 +61,5 @@ setTimeout(() => {
|
||||
| startPosition | 图片预览起始位置索引 | `Number` | `0` | 1.1.16 |
|
||||
| showIndex | 是否显示页码 | `Boolean` | `true` | 1.3.4 |
|
||||
| showIndicators | 是否显示轮播指示器 | `Boolean` | `false` | 1.3.10 |
|
||||
| loop | 是否开启循环播放 | `Boolean` | `true` | 1.4.4 |
|
||||
| onClose | 关闭时的回调函数 | `Function` | - | 1.1.16 |
|
||||
|
Loading…
x
Reference in New Issue
Block a user