点击不显示模块弹出
返回的数组里面有name?你是如何使用这个name的?
<el-table-column prop="name" label="图片" width="120">
<template slot-scope="scope">
<div>{{scope.row.xxx.name}}</div>
</template>
</el-table-column>
如果有类似上面的代码请修改为:
<el-table-column prop="name" label="图片" width="120">
<template slot-scope="scope">
<div>{{scope.row.xxx&&scope.row.xxx.name}}</div>
</template>
</el-table-column>
问题找到了,已经解决了谢谢大佬们
<el-table-column v-if="cameraColData[13].istrue" label="摄像机类型" width="100">
<template slot-scope="scope">{{ getCameraType(scope.row.cameraType) }}</template>
</el-table-column>
因为后台传入一个code :0 name:""
cameraTypeList: [
{ name: "监控型机枪", code: 1 },
{ name: "监控型球机", code: 2 },
{ name: "全景型", code: 3 },
{ name: "抓拍机", code: 4 }
],
getCameraType(type){
var typeName
for(var i in this.cameraTypeList){
if(this.cameraTypeList[i].code+''==type+''){
typeName=this.cameraTypeList[i].name
}
}
return typeName ? typeName : ''
},
13 回答12.8k 阅读
8 回答2.6k 阅读
2 回答5.1k 阅读✓ 已解决
7 回答2k 阅读
9 回答1.7k 阅读✓ 已解决
3 回答2.2k 阅读✓ 已解决
5 回答903 阅读
tableList在data里面是数组吗 在模板里面添加v-if="tableList.length"试试