Reputation: 68482
If I need to access a computed property 20 times in one function, is it better to assign the value of it to a local variable first?
Would that improve performance?
Upvotes: 4
Views: 164
Reputation:
Computed properties are cached based on their reactive dependencies ... Computed Caching vs Methods
Vue.js automatically cache the computed value, as long as their reactive dependencies don't mutate.
Storing it in a variable would be counter-intuitive.
Upvotes: 6