- Why would you want to execute an invalid function by passing a function as an argument and then executing that function? Why not define invalidation functions directly inside return? The return value is very important in the error handling of asynchronous functions. It does not return a promise, but using async will return a promise, which is contradictory.
- WatchEffect is invoked before the component is updated. Is called before onBeforeUpdate.
- After the second option is used, the side effects are performed after onBeforeUpdate
- Can force synchronization trigger, but very inefficient, use as little as possible
- The watchEffect is executed before Mounted, so if you want to get the DOM, you can put it in the Mounted lifecycle, otherwise it doesn’t get the DOM the first time, it listens for updates and gets it the second time