[Improvement] ImagePreview: suppot onClose callback (#1589)

This commit is contained in:
neverland
2018-08-05 17:37:35 +08:00
committed by GitHub
parent 6f6bed4eb9
commit 428cb5059a
5 changed files with 74 additions and 21 deletions
+15 -6
View File
@@ -17,12 +17,19 @@ ImagePreview([
]);
```
#### Custom Start Position
#### Custom config
```javascript
ImagePreview([
'https://img.yzcdn.cn/1.jpg',
'https://img.yzcdn.cn/2.jpg'
], 1);
ImagePreview({
images: [
'https://img.yzcdn.cn/1.jpg',
'https://img.yzcdn.cn/2.jpg'
],
startPosition: 1,
onClose() {
// do something
}
});
```
#### Close Manually
@@ -42,4 +49,6 @@ setTimeout(() => {
| Attribute | Description | Type |
|-----------|-----------|-----------|
| imageUrls | Image URL list | `Array` |
| images | Images URL list | `Array` |
| startPosition | Start position | `Number` |
| onClose | Close callback | `Function` |