Coelacanth
Coelacanth

Reputation: 867

How to see which watchers get called in Vue.js?

I have a parent component, with many nested children components inside.

A click on one of my children's components updates the route. The route property is watched on the parent component, and does some actions on change.

This can be extremely difficult to debug if I don't know which component contains the watcher. Is there a way to see which watchers get executed?

Upvotes: 1

Views: 1360

Answers (1)

kissu
kissu

Reputation: 46814

Not sure if it helps but you may use the devtools to see which components emit something. enter image description here

On top of that, you could probably console.log in the watch or emit some additional payload to identify the component more easily.

Upvotes: 1

Related Questions