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

HTML snippet does not work in vue-html region #718

Closed
jericopulvera opened this issue Mar 7, 2018 · 12 comments
Closed

HTML snippet does not work in vue-html region #718

jericopulvera opened this issue Mar 7, 2018 · 12 comments
Labels

Comments

@jericopulvera
Copy link

VScode snippets do not work on .vue files after installing vetur

it works when I disable vetur

@xpopit
Copy link

xpopit commented Mar 24, 2018

screenshot at mar 24 21-52-36

screenshot at mar 24 21-51-22

not work

@jericopulvera
Copy link
Author

Enabled
enabled

Disabled
disabled

not work

@jericopulvera
Copy link
Author

I noticed that it works if it's outside the and <script> tag.

@octref
Copy link
Member

octref commented Apr 2, 2018

The problem is we declare the region <template> as vue-html, so html snippets won't work here. I have opened an upstream issue to track this support: microsoft/vscode/issues/47096

@octref octref added the upstream label Apr 2, 2018
@aphofstede
Copy link

@octref Looks like upstream issue was closed.

@octref
Copy link
Member

octref commented May 14, 2018

@jericopulvera @xpopit
Are the snippets your own snippets or snippets from other extensions?
If they are your own snippets, you can add "scope": ["vue-html"] to them.
For snippets from other extensions, there is no easy way to make them available under another language. I've reopened the upstream issue.

@naimlatifi5
Copy link

Yeap I tried as well and seems does not work on a new Vue.js file

@brada1703
Copy link

I had this problem as well. It may be a dumb question, but are you sure that VS Code detected that the language to be Vue? Mine was still in HTML for some reason (even though it was a .vue file) and wouldn't work. Whenever I switched the language to Vue, it worked perfectly. Hope this helps someone! :)

@octref octref changed the title VScode snippets does not work on .vue files after installing vetur HTML snippet does not work in vue-html region May 12, 2019
@tucq88
Copy link

tucq88 commented Aug 16, 2019

+1 here.
Out side of <template> tag my personal snippet works ok. But I can't do it inside template tag within a .vue file

@Viicos
Copy link

Viicos commented Dec 19, 2021

It looks like it's still not working so far. According to the docs, anything between <template></template> should have vue-html snippets available. But the snippets are behaving incorrectly:

Working correctly outside tags:

image

Does not work in the class tag (where it is always used for css classes):

image

Works outside the template:

image

The snippet package used can be found here (both html and vue-html languages are added in the package.json). When using the snippets in an ordinary html file, everything works fine.

@octref any thoughts on this?

@zzzgit
Copy link

zzzgit commented Jan 10, 2024

It's still an issue until Jan 2024.

@Viicos
Copy link

Viicos commented Jan 10, 2024

It's still an issue until Jan 2024.

Vetur isn't maintained anymore, you should switch to Volar.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

9 participants