Element UI 表格发布方式标签显示错误修正
在使用 Element UI 表格组件时,可能会遇到发布方式标签显示错误的问题。具体来说,在第三个 `el-tag` 标签中,应该使用 `v-else` 指令,而不是 `v-else=`。正确的代码应该是:
<el-table-column label='发布方式' min-width='100'>
<template #default='scope'>
<el-tag v-if='scope.row.publishType === 0' type='warning'>强制更新</el-tag>
<el-tag v-else-if='scope.row.publishType === 1' type='success'>非强制提醒</el-tag>
<el-tag v-else type='info'>非强制不提醒</el-tag>
</template>
</el-table-column>
通过使用正确的 `v-else` 指令,可以确保在 `publishType` 不等于 0 或 1 时,第三个标签会正确显示。这将避免出现标签显示错误的问题。
原文地址: http://www.cveoy.top/t/topic/blug 著作权归作者所有。请勿转载和采集!