表达式:
表达式? '表达式一' :'表达式二' ;
如果表达式为true则返回表达式一的值 若表达式为false 返回表达式二的值。
<script>
var num=prompt('输入数字');
var res=num>4?'Yes':'no';
alert(res);
</script>
<el-table-column
align="center"
prop="type"
label="处置类型"
style="width: 10%"
>
<template slot-scope="scope">
{{
scope.row.type == 1
? "线下加油"
: scope.row.type == 2
? "充值油卡"
: scope.row.type == 3
? "扫码加油"
: scope.row.type == 4
? "转售"
: scope.row.type == 5
? "续持"
: scope.row.type == 6
? "退款"
: ""
}}</template
>
</el-table-column>