ElemeFE / ElemeFE/element

el-table和v-show一起使用会导致列表无法正常渲染

Open
#22,654 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Vue
Stars
54k
Forks
14.4k
PR merge metrics
No merged PRs in 30d

Description

# 原因
我的业务场景是el-table + v-show组件一起使用,由于v-show的状态切换导致el-table的列头无法正常渲染。
# 期待效果
当v-show状态切换时,el-table能够正常渲染
# 尝试使用的方法
我尝试使用 v-if来解决,可以解决但是满足不了我的业务需求,因此只能用v-show;之后我又尝试使用key来达到diff渲染效果,可以成功达到需求,但是vue抛出报错 [Vue warn]: You may have an infinite update loop in a component render function。希望能够知道这个问题如何解决

#效果如下
![image](https://github.com/ElemeFE/element/assets/131439622/96e748e2-fa14-493c-b500-ede1c063af06)

使用v-show隐藏后出现报错
![image](https://github.com/ElemeFE/element/assets/131439622/5f07e21a-ec4e-4eee-a3f6-31058528076c)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.