<el-table-column label="报警等级">
<template slot-scope="scope">
{{ (levelArr[scope.row.alarmLevel] || "-") + "级" }}
//利用数组包裹
</template>
</el-table-column>
data() {
return {
/**历史故障 */
historyDataChendList: [],
//在data里面定义
levelArr: {
1: "一",
2: "二",
3: "三",
4: "四",
5: "五",
6: "六",
7: "七",
8: "八",
9: "九",
10: "十",
},}
vue后台反数字&字符串利用字典转汉字回显到页面
最新推荐文章于 2024-05-28 14:09:03 发布