页面:
<i :style="{color: getColor(item.status)}" ></i>
数据:
data(){
return{
colors: {
complated: '#268cf0',
danger: '#FEAA00',
delay: '#FD4443',
undo: '#E4E9EF'
},
}}
方法:
methods:
getColor(status) {
switch (status) {
case 0:
return this.colors.undo;
case 1:
return this.colors.complated;
case 2:
return this.colors.danger;
case 3:
return this.colors.delay;
}
},
vue动态设置每个li的样式
最新推荐文章于 2023-03-27 16:00:32 发布