-
Notifications
You must be signed in to change notification settings - Fork 94
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
how to update data? #114
Comments
Check this link: https://amsik.github.io/liquor-tree/#Integration-with-Vuex |
@amsik thanks. is it possible without vuex and store? |
i have another question too. |
You don't have to use Vuex. It is a way to control the tree's data. options: {
store: {
store: Store,
getter: () => {
return this._myTree
},
dispatcher(tree) {
this._myTree = tree
}
}
} |
It's not possible to pass or condition. You have to do something like: const nodes = ['1', '2', '3'].map(id => this.$refs.tree.find({ id: id}) ) |
It doesn't work because we don't have access to this._myTree inside getter and dispatcher
|
You can use arrow functions |
@amsik Could you please explain HOW you control the data without using Vuex? You show code using a Store, don't you? Please show a code sample with a classic data model. Thanks! |
I faced the same issue that the :data prop you pass into the liquor tree would not reactively update when the tree gets edited. The workaround I used is to place event handlers on the tree like so:
The
From this point on you could either update the local state of your vue component or do whatever you want with the updated tree data. As a final touch, you can use this recursive function as a starting point to transform the data you get from
Of course, this is not a preferred solution and its most likely best to include vuex. However, like in my case, this offers a practical alternative to get the updated data from the tree. Good luck with this solution 👨🏽💻 |
Is there anyway to refresh async data? i try with :data="getDataAsync" but not work. i don't know how to do this with options. it works just once with options but i want when user clicks a button refresh data...
The text was updated successfully, but these errors were encountered: