K
K
Kirill Petrov2017-10-17 11:56:32
JavaScript
Kirill Petrov, 2017-10-17 11:56:32

How to properly write/post data to vuex from a nested component tree?


In vuex , you need to save data through mutations, so that the time machine would work, etc.
https://jsfiddle.net/3p0j5sgy/1122/
Each child component does not have access to the entire tree, and changing through a loop is also not very productive when there are thousands of rows of data. I ask for help in writing an easy and elegant solution :)
Thank you!

Answer the question

In order to leave comments, you need to log in

1 answer(s)
K
Klein Maximus, 2017-10-17
@Recosh

In fact, the item component is a "stupid" component (a pure function), so it would be better to return all the changes that it makes by events along the chain to the nearest "smart" component, and let it perform the necessary transformations in the store.
https://jsfiddle.net/3p0j5sgy/1125/ is that what you need?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question