vue根据数字显示对应的文字状态
vue根据数字显示对应的文字状态(三元运算符)
vue三元运算符两个判断
<el-table-column:label="$t('siitservice.smartarkconfig.status')"prop="status"width="80"align="right"class-name="is-hidden-popoper"><template slot-scope="scope">{{scope.row.status=='0'?"禁用":scope.row.status=='1'?"启用":''}}</template>显示样式:
vue三元运算符多个判断
<el-table-column align="center"prop="methods"label="缴费方式"><template slot-scope="scope">{{scope.row.methods==1?"现金支付":scope.row.methods==2?"刷储蓄卡支付":scope.row.methods==3?"刷信用卡支付":scope.row.methods==4?"微信二维码扫码支付":scope.row.type==5?"支付宝二维码扫码支付":scope.row.type==6?"刷脸支付":""}}</template></el-table-column>还有其他方式,比如计算属性…
