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

When the onload callback does not add children, the tree component throws an exception #772

Closed
ZerroRt opened this issue Aug 4, 2021 · 1 comment · Fixed by #786
Closed
Assignees
Labels
bug Something isn't working priority: high

Comments

@ZerroRt
Copy link

ZerroRt commented Aug 4, 2021

TuSimple/naive-ui version (版本)

2.16.0

Vue version (Vue 版本)

3.2.0-beta.7

Browser and its version (浏览器及其版本)

Microsoft Edge(92.0.902.62)

System and its version (系统及其版本)

Windows Feature Experience Pack 421.18901.0.3

Node version (Node 版本)

Reappearance link (重现链接)

https://codesandbox.io/s/nervous-meadow-dw77n?file=/src/Demo.vue

Reappearance steps (重现步骤)

In the onload callback, children are not added to the current node but directly return Promise.resolve()

Expected results (期望的结果)

The node is folded again, and when it is clicked again to try to open, try to trigger the reload logic again

Actual results (实际的结果)

Throw an error "Cannot read property'forEach' of undefined" (in sandbox) or the node is stuck in the loading state

Remarks (补充说明)

@github-actions github-actions bot added the untriaged need to sort label Aug 4, 2021
@Volankey Volankey added bug Something isn't working priority: high and removed untriaged need to sort labels Aug 4, 2021
@Volankey Volankey self-assigned this Aug 4, 2021
@07akioni
Copy link
Collaborator

07akioni commented Aug 4, 2021

It's caused by expanding logic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working priority: high
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants