方式一:
<el-table-column prop="DataType" label="数据来源">
<template slot-scope="scope">
{{ scope.row.DataType ? DataTypeList[(scope.row.DataType)].label : '未知来源' }}
</template>
</el-table-column>
DataTypeList: {
'1': {
label: '车辆年检'
},
'2': {
label: '遥感遥测'
},
'3': {
label: '黑烟车抓拍 '
},
'4': {
label: '路检路查 '
}
},
方式二:
<template slot-scope="scope">
<p v-if="tableData[scope.$index].Status==1">正常</p>
<p v-if="tableData[scope.$index].Status==2">报警</p>
</template>