You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
From my understanding of VueJS, one should avoid calling methods in templates and use computed properties instead as they are cached.
As you can see in this minimal exemple : https://codepen.io/thomaskientz/pen/RwJRZXB every methods in a template are being called every time the user interact with the view.
For small projects, or note interactive UI, it is fine. But for larger projects, with lots of reactive data, it can impact performances and increase CPU usage, isn't it ?
reacted with thumbs up emoji reacted with thumbs down emoji reacted with laugh emoji reacted with hooray emoji reacted with confused emoji reacted with heart emoji reacted with rocket emoji reacted with eyes emoji
-
From my understanding of VueJS, one should avoid calling methods in templates and use computed properties instead as they are cached.
As you can see in this minimal exemple : https://codepen.io/thomaskientz/pen/RwJRZXB every methods in a template are being called every time the user interact with the view.
The current docs shows everywhere exemples of calling methods in templates (https://kazupon.github.io/vue-i18n/started.html)
For small projects, or note interactive UI, it is fine. But for larger projects, with lots of reactive data, it can impact performances and increase CPU usage, isn't it ?
The doc should mention this somewhere.
What are your thoughts on this ?
Beta Was this translation helpful? Give feedback.
All reactions