安装插件
npm install v-viewer --save
// 在main.js中全局引用
import Viewer from "v-viewer"// 图片预览
import "viewerjs/dist/viewer.css"// 图片预览
Vue.use(Viewer)
Viewer.setDefaults({
defaultOptions: {
zIndex: 9999
},
Options: {
"inline": true,
"button": true,
"navbar": true,
"title": true,
"toolbar": true,
"tooltip": true,
"movable": true,
"zoomable": true,
"rotatable": true,
"scalable": true,
"transition": true,
"fullscreen": true,
"keyboard": true,
"url": "data-source"
}
})
在表格中使用就可以了
<el-table-column label="行驶证">
<template slot-scope="scope">
<viewer>
<span v-for="(list,index) in scope.row.xszpicList">
<img
style="width: 60px;"
:src="dama+list.img"
>
</img>
</span>
</viewer>
</template>
</el-table-column>