1.如果是全局注冊vant的情況下,只需在需要使用的組件里面引入即可

2.給圖片添加click事件 (一定使用一個元素包裹div,會有好處的!!)
<header>
<div class="img_box" v-for='(item2,index) of images' :key='index'>
<img :src="item2" alt="" @click="getImg(item2,index)">
</div>
</header>

3.

4.點擊事件
getImg(images,index){ ImagePreview({ images: this.images, showIndex:true, loop:false, //是否循環播放 startPosition:index }) } }

