How to add VS Code snippet inside a template

329 Views Asked by At

I am trying to create ionic vue snippets. So far it seems to only work when added on the top level and not working when added inside a template or div tag. How can I insert snippets inside these tags?

Snippet

  "ionic-vue Item": {
    "prefix": "ivitem",
    "body": [
      "<ion-item>",
        "<ion-label>",
          "${1:Item}",
        "</ion-label>",
      "</ion-item>"
    ],
    "description": "Creates ionc-vue item"
  },

enter image description here

1

There are 1 best solutions below

0
On BEST ANSWER

Set the snippet scope to html,vue-html:

{
  "ionic-vue Item": {
    "scope": "html,vue-html",
    //...
  }
}