[improvement] ImagePreview: add loop prop (#2103)

This commit is contained in:
neverland 2018-11-18 10:03:45 +08:00 committed by GitHub
parent 10f0604ad0
commit 0dbf1c5ee2
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 11 additions and 3 deletions

View File

@ -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

View File

@ -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` | - |

View File

@ -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 = () => {

View File

@ -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 |