157k views
8 votes
How to trigger watchers on initialization in vue.js ?

User Raeven
by
3.2k points

1 Answer

8 votes

Answer:

variable when the component is mounted. This triggers the watchers which then triggers an emit i have in the watcher. I do not want the emit to happen when the variable is only being initialized. The variable is from the data section of the vue component.

User Slembcke
by
3.8k points