Methods vs Computed in Vue

Ayu Adiati - Jun 25 '21 - - Dev Community

Hello 👋🏼,

Lately I've been learning Vue.
So today I learned about computed property.

In my understanding (please correct me if I'm wrong), computed is the same as methods property, only it will be re-executed if data that are used within the property are changed.
While methods property will be re-executed for any data changes within the page.

In which condition is the best practice to use methods or computed?

Thank you in advance for any help 😊

. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .