Reputation: 113
i did read about reactive concept in vuejs. https://ru.vuejs.org/v2/guide/reactivity.html.
And i checked this concept. For every properties in object rewrite native getter and setter. How deeply the properties are rewritten? And how does this affect performance?
Upvotes: 1
Views: 300
Reputation: 2529
Anything that is declared in data() is reactive, irrespective of how 'deep' it is.
If you mutate an array or add properties later to an object you can break reactivity. My tips are to
In terms of performance, I am building an application with big lists on a page (arrays with totals of 10,000+ objects with at least 20 properties in each object). It has been handling everything just fine. I did get some performance issues with memory leaks, but I was able to fix them by setting the arrays to [] on beforeDestroy().
With Vue, it really is easier to have all your data stay reactive. This allows you to inspect it with the Vue Devtools and more easily rely on its behavior. Vue does very funky stuff when data is not reactive or when reactivity breaks.
Upvotes: 1