三目运算符,多条件判断

上述条件表达式中,表达式3部分又是一个条件表达式.根据条件表达式的结合性,上述条件表达式等价于:

引用

 

x>0?1:(x<0?-1:0)

vue elementui中判断三个状态

<template slot-scope="scope">
<el-tag :type="scope.row.auditStatus === '已通过' ? 'primary' :(scope.row.auditStatus === '待审核'?'success':'danger')" disable-transitions>{{scope.row.auditStatus}}</el-tag>
</template>
posted @ 2018-05-02 20:00  瑞蚨祥qianjin  阅读(6263)  评论(0编辑  收藏  举报