Vue-devtools: Dynamically created Vue instances

Created on 24 Dec 2015  路  5Comments  路  Source: vuejs/vue-devtools

Thanks for such an awesome devtool, it's really helpful. The problem I'm having is when I create a new Vue({ ... }) instance in a place such as $.ajax(...).done(function () { /* here */ }) this devtool doesn't show it. Is that something I'm doing wrong? Do you need a full example to reproduce the issue?

Most helpful comment

@hkan use case with multiple separated roots belongs to https://github.com/vuejs/vue-devtools/issues/98.
Try specifying parent:

var vm = new Vue({ el: '#root' }); // main root
var header = new Vue({ el: '#footer', parent: vm });

If this works, then I consider the issue resolved.

All 5 comments

I took a look through the source code. If only there's a way to call scan function in backend/index.js, I could do that manually every time, until somebody patches the devtool.

Is this still an issue for you? I create Vue instances on the fly using a similar mechanism and I can inspect them within DevTools.

@sirlancelot just tried new Vue({ el: '#footer' }); on console and it's not visible in Vue DevTools tab.

@hkan use case with multiple separated roots belongs to https://github.com/vuejs/vue-devtools/issues/98.
Try specifying parent:

var vm = new Vue({ el: '#root' }); // main root
var header = new Vue({ el: '#footer', parent: vm });

If this works, then I consider the issue resolved.

@simplesmiler yeah, if I specify a parent, Vue DevTools tab shows the new component.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bajzarpa picture bajzarpa  路  3Comments

stiltet picture stiltet  路  3Comments

pxwee5 picture pxwee5  路  3Comments

sparlos picture sparlos  路  3Comments

Gedminas picture Gedminas  路  3Comments