Vue-devtools: Enhancement: open console panel when sending vm to console

Created on 26 May 2016  路  11Comments  路  Source: vuejs/vue-devtools

The "Inspect DOM" button opens the "Elements" panel, but "Send to console" does not open the "Console" panel.

I believe opening the "Console" panel manually after clicking "Send to console" makes up for 90% of use cases of this buttons.

Most helpful comment

Another thing. Chrome gives developer a hint, that element is available as $0, by showing == $0 after the element name:

chrome-hint

I guess we can do the same, something like this:

vue-hint

vue-devtools already supports badges (fragment, router-view: <route>), so it should be reasonably easy to add a new badge.

All 11 comments

Why don't we take React's devtools approach? Selecting component in devtools binds it to $r in console automatically. Number of clicks stays the same, no need to fight with Chrome to switch the tab (if it is even possible).

Good point, I believe Chrome itself does it similarly.
Clicking on the element in the inspector binds it to $0. It actually goes further, and maintains a list of 5 last elements as $0 .. $4. Maybe we can do the same with $vm0 .. $vm5.

Yep. Not bad either, but to be honest for me it's a little confusing that it moves item to next position. But I'll be happy to make a PR that does that :)

/cc @yyx990803 for approval :wink:

@simplesmiler sounds good! (autobinding on click)

Ok, I'm on it

Cool. I think for compatibility reasons it should still bind $vm too, along with $vm0.

Another thing. Chrome gives developer a hint, that element is available as $0, by showing == $0 after the element name:

chrome-hint

I guess we can do the same, something like this:

vue-hint

vue-devtools already supports badges (fragment, router-view: <route>), so it should be reasonably easy to add a new badge.

So I pushed some changes. Please let me know what you guys think, any feedback is welcome. @simplesmiler @yyx990803

Kudos to @bartlomieju!

Was this page helpful?
0 / 5 - 0 ratings

Related issues

bajzarpa picture bajzarpa  路  3Comments

gustojs picture gustojs  路  3Comments

yyx990803 picture yyx990803  路  3Comments

pxwee5 picture pxwee5  路  3Comments

davestewart picture davestewart  路  3Comments