feat(ImagePreview): add closeable prop (#5654)

This commit is contained in:
landluck
2020-02-14 14:47:21 +08:00
committed by GitHub
parent 1d8e2654f5
commit 85a3707202
9 changed files with 180 additions and 4 deletions
+20
View File
@@ -35,6 +35,20 @@ ImagePreview({
});
```
### Show Close Icon
After setting the `closeable` attribute, the close icon will be displayed in the upper right corner of the pop-up layer, and the icon can be customized through the `close-icon` attribute, and the icon location can be customized by using the `close-icon-position` attribute
```js
ImagePreview({
images: [
'https://img.yzcdn.cn/1.jpg',
'https://img.yzcdn.cn/2.jpg'
],
closeable: true
});
```
### Async Close
```js
@@ -100,6 +114,9 @@ export default {
| lazyLoad | Whether to enable thumb lazy loadshould register [Lazyload](#/en-US/lazyload) component | *boolean* | `false` |
| maxZoom | Max zoom | *number \| string* | `3` |
| minZoom | Min zoom | *number \| string* | `1/3` |
| closeable | Whether to show close icon | *boolean* | `false` |
| closeIcon | Close icon name | *string* | `clear` |
| closeIconPosition | Close icon positioncan be set to `top-left` `bottom-left` `bottom-right` | *string* | `top-right` |
### Props
@@ -117,6 +134,9 @@ export default {
| lazy-load | Whether to enable thumb lazy loadshould register [Lazyload](#/en-US/lazyload) component | *boolean* | `false` |
| max-zoom | Max zoom | *number \| string* | `3` |
| min-zoom | Min zoom | *number \| string* | `1/3` |
| closeable | Whether to show close icon | *boolean* | `false` |
| close-icon | Close icon name | *string* | `clear` |
| close-icon-position | Close icon positioncan be set to `top-left` `bottom-left` `bottom-right` | *string* | `top-right` |
### Events