首先我们看到这个报错,这个报错的意思是说:无效的命名数据:“数据”类型检查失败。而且上面说了是Boolean类型错误,要把值改成"true",并且看到是tag标签的错误,于是检查代码:
<el-table-column prop="process_id" label="模板号" align="center" min-width="50"> <template v-slot="{ row }"> <div slot="content"> <el-tag v-if="row.process_id == 0" disable-transitions="true" type="warning">{{ `未定义模板` }}</el-tag> <el-tag v-else-if="row.process_id == 1" disable-transitions="true">{{ `基础模板` }}</el-tag> <el-tag v-else-if="row.process_id == 2" disable-transitions="true" type="success">{{ `自定义模板` }}</el-tag> </div> </template> </el-table-column>123456789
这里发现使用的值是"true",但是他执行时是按照String类型执行,而不是Boolean去执行的
查看文档
很经典的问题处理办法:加冒号
<el-table-column prop="process_id" label="模板号" align="center" min-width="50"> <template v-slot="{ row }"> <div slot="content"> <el-tag v-if="row.process_id == 0" :disable-transitions="true" type="warning">{{ `未定义模板` }}</el-tag> <el-tag v-else-if="row.process_id == 1" :disable-transitions="true">{{ `基础模板` }}</el-tag> <el-tag v-else-if="row.process_id == 2" :disable-transitions="true" type="success">{{ `自定义模板` }}</el-tag> </div> </template> </el-table-column>
作者:SmallTeddy
链接:https://blog.csdn.net/SmallTeddy/article/details/107204915
来源:CSDN
著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。