[new feature] ImagePreview: add asyncClose prop (#2198)

This commit is contained in:
neverland
2018-12-01 09:35:34 +08:00
committed by GitHub
parent 1b1e5caa19
commit 00fe13d800
6 changed files with 44 additions and 14 deletions
+9 -5
View File
@@ -32,13 +32,16 @@ ImagePreview({
});
```
#### Close Manually
#### Async Close
```javascript
const instance = ImagePreview([
'https://img.yzcdn.cn/1.jpg',
'https://img.yzcdn.cn/2.jpg'
]);
const instance = ImagePreview({
images: [
'https://img.yzcdn.cn/1.jpg',
'https://img.yzcdn.cn/2.jpg'
],
asyncClose: true
});
setTimeout(() => {
instance.close();
@@ -55,6 +58,7 @@ setTimeout(() => {
| showIndicators | Whether to show indicators | `Boolean` | `false` |
| loop | Whether to enable loop | `Boolean` | `true` |
| onClose | Close callback | `Function` | - |
| asyncClose | Whether to enable async close | `Boolean` | `false` |
### onClose Parematers