文件 => 首选项 => 用户代码片段 => 新建全局代码片段/或文件夹代码片段:vue-html.code-snippets

    注意:制作代码片段的时候,字符串中如果包含文件中复制过来的“Tab”键的空格,要换成“空格
    键”的空格。

    1. {
    2. "vue htm": {
    3. "scope": "html",
    4. "prefix": "vuehtml",
    5. "body": [
    6. "<!DOCTYPE html>",
    7. "<html lang=\"en\">",
    8. "",
    9. "<head>",
    10. " <meta charset=\"UTF-8\">",
    11. " <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">",
    12. " <meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">",
    13. " <title>Document</title>",
    14. "</head>",
    15. "",
    16. "<body>",
    17. " <div id=\"app\">",
    18. "",
    19. " </div>",
    20. " <script src=\"vue.min.js\"></script>",
    21. " <script>",
    22. " new Vue({",
    23. " el: '#app',",
    24. " data: {",
    25. " $1",
    26. " }",
    27. " })",
    28. " </script>",
    29. "</body>",
    30. "",
    31. "</html>",
    32. ],
    33. "description": "my vue template in html"
    34. }
    35. }

    在VS code 中输入 vuehtml
    image.png
    得到:
    image.png