amsik / liquor-tree

Tree component based on Vue.js
MIT License
398 stars 95 forks source link

The tree component rerenders when a v-model is changed #228

Closed abhic91 closed 3 years ago

abhic91 commented 3 years ago

I am using the liquor tree component in a form. Whenever an unrelated checkbox(from another form field) is checked, the tree is rerendered and comes to the state it was in when the page loads. The checked nodes in the tree are no longer checked.

I am using the liquor tree inside a v-for. https://www.codepile.net/pile/rqP3n5RE

Whenever I upload a file or check an unrelated checkbox, the tree is refreshed(The checked nodes are not checked, if tree is expanded before uploading a file, it collapses on uploading)

abhic91 commented 3 years ago

I'm very sorry. I was stupid enough to use Math.random for the key in v-for. It worked after I gave a proper key. Really sorry.