Calculate attribute

Evaluating attributes is a function in VUe3

  • This function is consistent with computed configuration
  • When you only have getter, you pass in a callback function
  • You have getters and setters, you pass in an object, you have get and set property methods
  • The return value is the calculated property we need

Watch function

  • The functions are the same as those configured on the Watch
  • Monitors one or more specified reactive data and automatically executes monitoring callbacks whenever the data changes
  • By default, the initial callback is not executed. However, you can specify that the initial callback is executed immediately by setting immediate to true
  • Set deep to true to specify that deep monitoring immediate and deep are configured in the third parameter

WatchEffect function

  • Instead of specifying the data to monitor directly, which reactive data is used in the callback function monitors which reactive data
  • By default, the first execution is performed initially so that data that needs to be monitored can be collected
  • Callback when monitoring data changes