el-table-column循环生成,循环中使用v-if,会出现数据显示错乱问题。
解决方法:
<el-table-column v-for="(item,index) in configTitleList" :prop="item.key" :key="index" :label="item.value"
>
<template slot-scope="scope">
<span v-if="item.key != 'statusName'">{{scope.row[item.key]}}</span>
<span v-else @click=“click()”>
{{scope.row.statusName}}
</span>
</template>
</el-table-column>
本文探讨了在Vue.js的Element UI中,如何使用el-table-column进行动态列渲染时遇到的数据错乱问题,重点介绍了通过v-if条件判断实现不同字段展示的方法,并提供了相应的代码示例和解决方案。
3596

被折叠的 条评论
为什么被折叠?



