vetur icon indicating copy to clipboard operation
vetur copied to clipboard

HTML snippet does not work in vue-html region

Open jericopulvera opened this issue 7 years ago • 10 comments

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

it works when I disable vetur

jericopulvera avatar Mar 07 '18 02:03 jericopulvera

screenshot at mar 24 21-52-36 screenshot at mar 24 21-51-22

not work

xpopit avatar Mar 24 '18 14:03 xpopit

Enabled enabled

Disabled disabled

not work

jericopulvera avatar Mar 26 '18 01:03 jericopulvera

I noticed that it works if it's outside the

jericopulvera avatar Mar 26 '18 01:03 jericopulvera

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 avatar Apr 02 '18 18:04 octref

@octref Looks like upstream issue was closed.

aphofstede avatar Apr 13 '18 22:04 aphofstede

@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.

octref avatar May 14 '18 14:05 octref

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

naimlatifi5 avatar Oct 19 '18 11:10 naimlatifi5

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! :)

brada1703 avatar Feb 24 '19 19:02 brada1703

+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

tucq88 avatar Aug 16 '19 01:08 tucq88

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?

Viicos avatar Dec 19 '21 16:12 Viicos

It's still an issue until Jan 2024.

zzzgit avatar Jan 10 '24 02:01 zzzgit

It's still an issue until Jan 2024.

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

Viicos avatar Jan 10 '24 07:01 Viicos