正常表格处理字典:
<el-table-column prop="exam_status" label="审核状态">
<template #default="scope">
<el-tag v-if="scope.row.exam_status" effect="plain">
{ {getDict(dicts.shzt, scope.row.exam_status)}}
</el-tag>
</template>
</el-table-column>
字典:
const dicts = ref({
shzt: [
{label: "待提交", value: "0",},
{label: "待审核", value: "1",}
]
});
表格数据:
const tableData = ref([{
exam_status: "1",
}])
方法:
// 传入字典数组,相对应值
function