mirror of
https://github.com/youzan/vant.git
synced 2026-05-05 01:00:55 +08:00
[Improvement] ImagePreview: suppot onClose callback (#1589)
This commit is contained in:
@@ -17,6 +17,12 @@
|
||||
<script>
|
||||
import { ImagePreview } from '../../../packages';
|
||||
|
||||
const images = [
|
||||
'https://img.yzcdn.cn/upload_files/2017/03/15/FkubrzN7AgGwLlTeb1E89-T_ZjBg.png',
|
||||
'https://img.yzcdn.cn/upload_files/2017/03/14/FmTPs0SeyQaAOSK1rRe1sL8RcwSY.jpeg',
|
||||
'https://img.yzcdn.cn/upload_files/2017/03/15/FvexrWlG_WxtCE9Omo5l27n_mAG_.jpeg'
|
||||
];
|
||||
|
||||
export default {
|
||||
i18n: {
|
||||
'zh-CN': {
|
||||
@@ -33,11 +39,10 @@ export default {
|
||||
|
||||
methods: {
|
||||
showImagePreview(position, timer) {
|
||||
const instance = ImagePreview([
|
||||
'https://img.yzcdn.cn/upload_files/2017/03/15/FkubrzN7AgGwLlTeb1E89-T_ZjBg.png',
|
||||
'https://img.yzcdn.cn/upload_files/2017/03/14/FmTPs0SeyQaAOSK1rRe1sL8RcwSY.jpeg',
|
||||
'https://img.yzcdn.cn/upload_files/2017/03/15/FvexrWlG_WxtCE9Omo5l27n_mAG_.jpeg'
|
||||
], typeof position === 'number' ? position : 0);
|
||||
const instance = ImagePreview({
|
||||
images,
|
||||
startPosition: typeof position === 'number' ? position : 0
|
||||
});
|
||||
|
||||
if (timer) {
|
||||
setTimeout(() => {
|
||||
|
||||
Reference in New Issue
Block a user