css采用三木运算嵌套层数过多,优化方案
<text :style="item.importance == 4 ? {color: '#fa3534'} : (item.importance == 3 ? {color: '#ff9900'} : (item.importance == 2 ? {color: '#D061FF'} : {color: '#000000'}))">
{{ formatImportance(item.importance) }}
</text>
修改====》
//修改后
<text :style="({
4:{color: '#fa3534'},
3:{color: '#ff9900'},
2:{color: '#D061FF'}
}[item.importance]|| {color: '#000000'}).color">
{{ formatImportance(item.importance) }}
</text>