iview表格通过render自定义改变字体颜色
作者:互联网
<Table :columns="columns" :data="dataSource" border :loading="loading"></Table>
export default {
data() {
return {
columns: [
{
title: '姓名', key: '', align: 'center', render: (h, params) => {
return h('div',[
h('span', {
style: {
color: '#f00'
}
}, params.name),
]);
}
},
],
loading: false,
}
}
}
根据状态改变颜色:
style: {color: params.name = 'a' ?'#0f0':'#f00'}
标签:style,自定义,render,color,name,params,f00,iview 来源: https://www.cnblogs.com/panwudi/p/16199646.html