一、安装
npm install v-viewer --save二、使用方法:
方法1:
<div class="images" v-viewer> <img v-for="(item2,index2) in item.picList.split(',')" :key="'img'+index2" :src="item2" /> </div> import 'viewerjs/dist/viewer.css' import Viewer from 'v-viewer' import Vue from 'vue' Vue.use(Viewer)方法2:
<viewer :images="images"> <img v-for="src in images" :src="src" :key="src"> </viewer> import 'viewerjs/dist/viewer.css' import Viewer from 'v-viewer' import Vue from 'vue' Vue.use(Viewer) export default { data() { images: ['1.jpg', '2.jpg'] } }以上两种方法都没问题,我爱模板网经过实战测试过!