1👍
Yes there are many differences. Watch
observes only changes in the reactive data passed as the first argument, so it only operates after the monitored properties have changed. As for beforeUpdate
, it is a life cycle that is called before the DOM is changed due to reactive data changes in the component, So it observes any reactive data in the component.
0👍
i think watch will triggerd after changing the data but beforeUpgrade is a hook and will look at the DOM for runnig something
0👍
With beforeUpdate
you can listen to any change in the component. It will be called if any of the reactive elements change that is used in rendering the component.
With watch
you can listen to specific reactive elements, even if they are not used in rendering the component.