iview表格依据条件渲染数据
2019-04-29 本文已影响97人
辉夜真是太可爱啦
使用render
函数,用一个if
来将数据进行渲染
{
title: '状态',
width: 80,
key: 'status',
align: 'center',
render: (h, params) => {
let texts = '';
if(params.row.status === 0){
texts = "下架"
}else {
texts = "上架"
}
return h('div', {
props: {
},
},texts)}
},