Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Table children 渲染报错 duplicate key #203

Closed
1 task done
bq-hentai opened this issue Sep 26, 2018 · 6 comments
Closed
1 task done

Table children 渲染报错 duplicate key #203

bq-hentai opened this issue Sep 26, 2018 · 6 comments
Labels

Comments

@bq-hentai
Copy link

bq-hentai commented Sep 26, 2018

  • I have searched the issues of this repository and believe that this is not a duplicate.

Version

1.1.3

Environment

Win7/vue 2.5

Reproduction link

Edit on CodeSandbox

Steps to reproduce

点击更新,核对 console 是否有异常日志。

What is expected?

没有异常日志,且界面不卡死。

What is actually happening?

有异常日志,且卡死。


子集数据原先在列表中(但是是children),更新数据之后放到父级会有问题。应该和这个 类似。

目前我的解决方案:在更新之前先赋值为空数组。

@tangjinzhou
Copy link
Member

这个的确是有重复的key导致的

@bq-hentai
Copy link
Author

@tangjinzhou see this

children中的 key 和父节点中的应该不影响。

@tangjinzhou
Copy link
Member

children中的key和父节点的key也不能重复,不然 selectedRowKeys 和 expandedRowKeys 无法扁平化方式使用。
你可以使用 :rowKey="record=>${record.key}-${record.xxx}"自定义key,或者预先处理key,保持唯一性

@bq-hentai
Copy link
Author

好吧,我看如果我先重置为空数组就没问题。具体的代码逻辑之后看看

@tangjinzhou
Copy link
Member

先重置为空数组依然也报重复key啊

@github-actions
Copy link

github-actions bot commented Apr 3, 2020

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 3, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants