This repository was archived by the owner on Dec 31, 2024. It is now read-only.
Avoid calling $t in templates and use computed properties instead #1580
ThomasKientz
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
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