-
Notifications
You must be signed in to change notification settings - Fork 21
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
Update node from walkTreeData #48
Comments
hello |
Thanks! That's actually what I tried first, but it didn't affect the tree. Trying it now in the sandbox works, so I have to find what's different in my main program that results in changing the nodes during the walkTreeData not to have any effect. |
Ok, the issue is setting the tree data and then immediately walking and updating the tree doesn't work. I'm trying to load the tree data from an API and then supplementing it with he-tree-vue specific attributes like "$draggable" depending on node attributes. I should probably just traverse the JSON object before applying it to the tree and sidestep the issue that way. |
you can try import {walkTreeData } from 'he-tree-vue' |
Thank you, I tried, but it didn't make a difference. I would have guessed it's some form of concurrency issue. New tree data is applied as step 1 and while the tree is still locked I'm walking it as step 2 and trying to change it, but the changed nodes can't be merged back? Not sure. |
I'm trying to walk the tree and update nodes.
I tried using code I found for earlier versions, but it doesn't seem to work anymore with Vue 3 / he-tree-vue 3.0.0.
Trying to use this.$set() results in this error:
I prepared a sandbox to reproduce the issue. Please click "Hide" or "Show hidden" to trigger it:
https://codesandbox.io/s/vue-cli-and-he-tree-vue-example-forked-xv1ww?file=/src/components/TreeView.vue
How can I walk through all the nodes of the tree and update their attributes?
Thank you for your help and this amazing component!
The text was updated successfully, but these errors were encountered: