Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Differentiate between vue inspector and component tree inspector #294

Open
maxirozay opened this issue Mar 26, 2024 · 9 comments
Open

Differentiate between vue inspector and component tree inspector #294

maxirozay opened this issue Mar 26, 2024 · 9 comments
Labels
client scope: devtools client pr welcome

Comments

@maxirozay
Copy link

I just updated all my vue/vite dependencies and installed vue-devtools 7.0.21. I'm on macOS Sonoma 14.4.

When I use the target button inside the components tab, the devtools is minimized, I can select a component on my website and it will open in the devtools. Everything works very well.

When I do the same with the main target button next to the vue icon, the devtools is not minimized, it doesn't do anything in the devtools and open the file with a broken vim in vscode (I can't use vim commands, whatever I do will insert some characters). Basically it does the same as the "open in editor" button does.

Also if I click again on the target it doesn't stop the component selection so it doesn't seem like it's a toggle like its title suggest.

Shouldn't the 2 target button have the same behavior (especially the fact that the devtool is hidden to select the component)?
When the component is opened in the editor is it possible to open the file directly in vscode instead of creating a vim session in the current terminal?

@webfansplz
Copy link
Member

webfansplz commented Mar 26, 2024

Do you mean the open in editor feature? You can follow the documentation to configure it.

@maxirozay
Copy link
Author

I mean the main target button next to the vue icon at the bottom (you can also see it when the devtools is minimized), it act like the open in editor button from the components tab and not like the target button in the component tab. So I guess yes it's this feature and it's on purpose which is useful but then why not also hide the devtools when you click on it ?

Thank you for the doc. I installed the code command and the VUE_EDITOR=code env. They both work, I restarted everything and it still open the file with vim inside my vscode terminal. I get the following warnings before it opens vim.

Vim: Warning: Output is not to a terminal
[0] Vim: Warning: Input is not from a terminal

@xuzuodong
Copy link
Contributor

IMO those two buttons should have different icons since they have different behaviors.

image

@alexzhang1030 alexzhang1030 added the client scope: devtools client label May 7, 2024
@alexzhang1030
Copy link
Collaborator

Agree with that, PR welcome.

@maxirozay
Copy link
Author

It can be an "edit" pen.

<svg
  xmlns="http://www.w3.org/2000/svg" style="height: 1.1em; width: 1.1em; opacity:0.5;"
  :style="vueInspectorEnabled ? 'opacity:1;color:#00dc82;' : ''" viewBox="0 0 24 24"
>
  <g fill="none" stroke="currentColor" stroke-linecap="round" stroke-linejoin="round" stroke-width="2">
    <path d="M4 16 L18 2 L22 6 L8 20 L2 22Z" />
  </g>
</svg>

This one may be a bit too simplistic. If you have a specific icon I can make a PR.

@alexzhang1030
Copy link
Collaborator

You can choose one from iconify, then use it by unocss-icon-preset.

Commonly it will be class="i-<icon-name>", like this class="i-carbon-moon"

@maxirozay
Copy link
Author

In the overlay package there's no unocss package installed and the target icon is the svg that I edited and pasted in my previous comment. I can copy an icon from iconify to replace the current svg.

@alexzhang1030
Copy link
Collaborator

In the overlay package there's no unocss package installed and the target icon is the svg that I edited and pasted in my previous comment. I can copy an icon from iconify to replace the current svg.

Oh, then svg will be good

@maxirozay
Copy link
Author

I made a PR with the this icon, I can use another one if there's better.

@alexzhang1030 alexzhang1030 changed the title main "toggle component inspector" button doesn't work like the one in the component tab Differentiate between vue inspector and component tree inspector May 20, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
client scope: devtools client pr welcome
Projects
None yet
Development

No branches or pull requests

4 participants