Element-UI el-table-column 使用slot插槽v-if数据更新后没有渲染


原因是因为表格是element-ui通过循环产生的,而vue在dom重新渲染时有一个性能优化机制,就是相同dom会被复用,通过key去标识一下当前行是唯一的,不许复用,就行了。

在其和其之后的一个显示的组件上添加 :key="Math.random()"

       
          
..............................

参考博客

Element-UI el-table-column 使用slot插槽 v-if 报错

vue