场景:需要将数据(id)转变成另一种数据(name)显示出来
代码:
1.加入:formatter方法
<el-table-column prop="scopeId" label="大类" align="center" :formatter="scopeIdFormat" width="auto" />
2.方法逻辑
methods:{
//大类显示对应状态
scopeIdFormat(row, column, cellValue){
let a = this.signscopes.filter((x)=> x.id == row.scopeId ); //筛选对应值
return a[0].signScope; //返回值
}
}