vscode快速生成自定义HTML模板

https://www.cnblogs.com/wgyhon/p/11466449.html

模板:

 1 {
 2     // Place your snippets for html here. Each snippet is defined under a snippet name and has a prefix, body and 
 3     // description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:
 4     // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the 
 5     // same ids are connected.
 6     // Example:
 7     // "Print to console": {
 8     //     "prefix": "log",
 9     //     "body": [
10     //         "console.log('$1');",
11     //         "$2"
12     //     ],
13     //     "description": "Log output to console"
14     // }
15     "h5 template": {
16         "prefix": "vh", // 对应的是使用这个模板的快捷键
17         "body": [
18             "<!DOCTYPE html>",
19             "<html lang=\"en\">",
20             "<head>",
21             "\t<meta charset=\"UTF-8\">",
22             "\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">",
23             "\t<meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">",
24             "\t<title>Document</title>",
25             "\t<script src=\"./node_modules/vue/dist/vue.js\"></script>",
26             "</head>",
27             "<body>",
28             "\t<div id =\"app\">\n",
29             "\t</div>\n",
30             "\t<script src=\"./node_modules/vuex/dist/vuex.js\"></script>",
31             "\t<script>",
32             "\t //创建Vue实例,得到 ViewModel",
33             "\t var vm = new Vue({",
34             "\t\tel: '#app',",
35             "\t\tdata: {\n",
36             "\t\t},",
37             "\t\tmethods: {\n",
38             "\t\t}",
39             "\t });",
40             "\t</script>",
41             "</body>",
42             "</html>"
43         ],
44         "description": "HT-H5" // 模板的描述
45     }
46 }

 

posted @ 2020-04-18 18:34  遥望那月  阅读(2880)  评论(0编辑  收藏  举报