npm install v-viewer
在main.js引用viewer
import Viewer from 'v-viewer'
import 'viewerjs/dist/viewer.css'
app.use(Viewer, {
defaultOptions: {
title: false,
toolbar: false
}
})
使用
<viewer :images="imgData">
<div v-for="img in imgData" :key="img.id">
<img style="width:50px;height:50px" :src="img.url">
</div>
</viewer>
//==========或
<img style="width:50px;height:50px" :src="imgUrl">