0👍
watch
is lazy by default, meaning it would only run after an initial change to the source has occurred.
adding immediate: true
essentially let’s the callback of the watch to run when the component is initialized. In essence, like the do
block of a do while
loop in certain languages.
you can find more and the deep and eager watch at the docs
https://vuejs.org/guide/essentials/watchers.html
Source:stackexchange.com