Answer the question
In order to leave comments, you need to log in
Which approach to modifying data does Vue use, mutability or immutability?
Please explain how to write applications in vue?
In the documentation for React, the authors of the framework recommend using immutability ( https://ru.reactjs.org/tutorial/tutorial.html#why-... in their opinion, this is the most correct way to build applications, their position is unequivocally clear.
Vue has v-model directive ( https://ru.vuejs.org/v2/api/#v-model)which provides two-way binding, which is the mutation approach. At the same time, when working with components, the props property is used to transfer data to the components, and events are used to return (this is very similar to what is recommended in React), and if inside the component we still use data binding to interface elements (for example, to ) data through v-model, then changes in the child component will still affect the data in the parent component and the mutation approach will still turn out.
Do I understand correctly that Vue recommends an approach through mutations, or do these two frameworks have the same approach?
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question