The difference between vue computed properties and listening properties

1. Computed properties
  • Computed properties are cached based on their dependencies, while calling methods are always recomputed each time. If you don't need caching, use the method.
  • When you have some data that needs to change with other data changes,It's usually better to use computed properties instead of imperative watch callbacks.
2. Listening property watch
  • This is most useful when you need to perform asynchronous or expensive operations when data changes .

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324777726&siteId=291194637