element-ui Tag 标签 运用三元表达式进行多级状态判断并赋值
<el-tag>
{{ scope.row.auditStatus == 0? '初始值' : (scope.row.auditStatus == 1? '审核通过' : (scope.row.auditStatus == 2? '审核不通过' : ‘待审核’)) }}
</el-tag>
同理 tag标签的type属性也可以通过此操作 来进行样式覆盖
:type = (scope.row.auditStatus == '0'? ' ' : (scope.row.auditStatus == '1'? 'success' : (scope.row.auditStatus == '2'? 'warning' : 'danger') ) )

浙公网安备 33010602011771号