vscode怎么生成模板


当前第2页 返回上一页

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

23

24

25

26

27

28

29

30

31

32

33

34

35

36

37

38

39

40

41

{

    // Place your snippets for html here. Each snippet is defined under a snippet name and has a prefix, body and

    // description. The prefix is what is used to trigger the snippet and the body will be expanded and inserted. Possible variables are:

    // $1, $2 for tab stops, $0 for the final cursor position, and ${1:label}, ${2:another} for placeholders. Placeholders with the

    // same ids are connected.

    // Example:

    // "Print to console": {

    //     "prefix": "log",

    //     "body": [

    //         "console.log('$1');",

    //         "$2"

    //     ],

    //     "description": "Log output to console"

    // }

    "Html5-Vue": {

        "prefix": "vh",

        "body": [

            "<!DOCTYPE html>",

            "<html lang=\"zh-CN\">\n",

            "<head>",

            "\t<meta charset=\"UTF-8\">",

            "\t<meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\">",

            "\t<meta http-equiv=\"X-UA-Compatible\" content=\"ie=edge\">",

            "\t<title>Document</title>",

            "\t<script src=\"./lib/vue.min.js\"></script>",

            "</head>\n",

            "<body>",

            "\t<div id=\"app\">$1</div>\n",

            "\t<script>",

            "\t\tvar vm = new Vue({",

            "\t\t\tel: '#app',",

            "\t\t\tdata: {},",

            "\t\t\tmethods: {}",

            "\t\t});",

            "\t</script>",

            "</body>\n",

            "</html>"

        ],

        "description": "快速创建在html5编写的vue模板"

    }

}

这里的 “prefix”: “vh”,指的是你自定义的快捷代码,这里我输入h就会出现快速生成代码提示,也可以自定义其他字段。

53d8ac3cf191fc0d6713f8e9939f4a5.png

效果如下:

6cd725095329e1b4fda37a28233706c.png

以上就是vscode怎么生成模板的详细内容,更多文章请关注木庄网络博客

返回前面的内容

相关阅读 >>

vsCode怎么打开vue

vue代码怎么在vsCode运行

vsCode怎么导入jar包

推荐10个vsCode中很棒的浅色主题

vsCode怎样设置c语言开发环境

vsCode怎么显示空格和tab符号

聊聊vsCode中如何配置markdown代码片段

如何使用vsCode将项目上传到github

vsCode如何调试ajax

vsCode怎么运行出结果

更多相关阅读请进入《vsCode》频道 >>



打赏

取消

感谢您的支持,我会继续努力的!

扫码支持
扫码打赏,您说多少就多少

打开支付宝扫一扫,即可进行扫码打赏哦

分享从这里开始,精彩与您同在

评论

管理员已关闭评论功能...