elementUI表格中预览图⽚
表格中有⼀列显⽰的图⽚,现需要点击图⽚,预览该图⽚,使⽤的elementui中的previewSrcList做的图⽚预览,但是测试发现,⽆论点击表格中的那张图⽚,预览的⼤图都是从第⼀张图⽚,开始预览;
后⾯通过更改每张图⽚绑定的图⽚list的顺序,解决了次问题;
cumulative
页⾯显⽰:
<el-table-column property="path" label="图⽚" align="center">
企业财务通则
<template slot-scope="scope">harddisk是什么意思
truelove
<el-image
结果英文
:src="w.path"
wap歌词直白翻译
par error:preview-src-list="w.list"
>
</el-image>
</template>
</el-table-column>
js:
getDrawerTableList(data) {
this.drawerTableList = data;krusty
bridlethis.list = [];
// 表格数据 drawerTableList
//获取每张图⽚的地址
for(var i = 0 ; i < this.drawerTableList.length ; i ++){
this.list.push(this.drawerTableList[i].path)
}
//根据图⽚顺序(index)更改每张图⽚绑定的list的图⽚顺序
for(var i = 0 ; i < this.drawerTableList.length ; i ++){
// this.list.push(this.drawerTableList[i].path)
var container = this.list;
var frontArr = container.slice(0,i);
var behindArr = container.slice(i,this.drawerTableList.length);
var list = at(frontArr)letterpress
this.drawerTableList[i].list = list;
}
},