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') ) ) 

posted @ 2020-11-27 14:32  贺可英  阅读(2137)  评论(0)    收藏  举报