Vetur: User Snippets not loading correctly

Created on 6 Feb 2017  路  3Comments  路  Source: vuejs/vetur

I've created my own snippet for Vue files, but using this plugin it doesn't load any suggestion. For example, adding this snippet configuration:

    "Vue Template": {
        "prefix": "full",
        "body": [
            "<template>\n",
            "</template>\n",
            "<script>",
            "export default {\n\tname: \"$TM_FILENAME\"\n}",
            "</script>\n",
            "<style lang=\"scss\">\n",
            "</style>"
        ],
        "description": "Vue Template"
    }

user snippet

Indeed, it doesn't show any snippet at all. Only when I manually add the <template>, <script> or <style> tags.

bug

Most helpful comment

Alright, this will take a larger change on the grammar than I expected. But once it get fixed you should be able to use different snippets in each regions (vue, html, scss, less, js). Might take a few days as I'm busy.

All 3 comments

Alright, this will take a larger change on the grammar than I expected. But once it get fixed you should be able to use different snippets in each regions (vue, html, scss, less, js). Might take a few days as I'm busy.

With the next version you can:

  • Use Vue snippet outside <template>, <style>, and <script>
  • Use each language's snippet, like scss snippet in <style lang="scss">

You won't be able to use html snippet yet, as I'm thinking about introducing vue-html as a new language to give it better syntax highlight / IntelliSense.

Give it a try in 0.3.3. Let me know any issues!

Was this page helpful?
0 / 5 - 0 ratings