Vscode: Emmet doesn't work in Vue <template> tag.

Created on 14 Mar 2017  路  12Comments  路  Source: microsoft/vscode

  • VSCode Version: 1.10.2
  • OS Version: Windows 10 build 15055

Steps to Reproduce:

  1. I use Vue 2 Snippets, vetur extensions, and I edit my settings.json file, add "emmet.syntaxProfiles" options.
// Vue emmet support
    "emmet.syntaxProfiles": {
        "vue": "html"
    },
  1. .vue files language is Vue not plain text.

tim 20170314145402

  1. Emmet work in empty vue file, but not work in <template> tag.
template>div>ul>li*3

tim 20170314145638

tim 20170314145816

I lost some settings?

Most helpful comment

"emmet.showAbbreviationSuggestions": true,
"emmet.showExpandedAbbreviation": "always",
"emmet.includeLanguages": {
        "vue-html": "html",
        "vue": "html"
},

my setting, i add these

All 12 comments

This is the first thing in vetur's README...https://github.com/octref/vetur#setup

image

@ramya-rao-a @aeschli feel free to cc me for anything related to vetur/vue, or ask people to move vue specific issues over.

Thanks @octref :)

@octref @ramya-rao-a
I solved the problem!

It is not settings problem, Vue 2 Snippets and vetur conflicts, disable one can fix.

"emmet.showAbbreviationSuggestions": true,
"emmet.showExpandedAbbreviation": "always",
"emmet.includeLanguages": {
        "vue-html": "html",
        "vue": "html"
},

my setting, i add these

Yes, it works. But not always correctly ...

@timurmelnikov Can you share an example?

The one case where you will not get emmet suggestions is when you want to expand a simple word to <word></word>

This was done because otherwise emmet suggestions will show up for every word you ever type which can be noisy.

word.noise or word>child etc i.e actual abbreviations or commonly used tags like div, span, body should show up in emmet suggestions

@timurmelnikov I am not able to reproduce the issue. Can you try the latest Insiders and see if you see your issue there? https://code.visualstudio.com/insiders

After updating to version 1.15.1, the error has disappeared. Everything works perfectly! Thank you!

@timurmelnikov Great, Happy Coding!

@ramya-rao-a Hi, does it still not support those customize tag, like word, dialog?

@DanielWLam The Emmet: Expand Abbreviation should still work for them. And if you have set emmet.triggerExpansionOnTab to true, then tab should work as well

Was this page helpful?
0 / 5 - 0 ratings