VsCode + node+ vue.js 开发环境搭建(二)

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/xiajing13579/article/details/82660266

1.代码模板:

在 文件---首选项----用户代码片段中 找到 html.json 可以加入自己模板文件如下:

    "html5": { // 带VUE.js 的HTML文件

        "prefix": "html5vm",

        "body": [

            "<!DOCTYPE html>",

            "<html lang=\"$1zh-CN\">",

            "\t<head>",

            "\t\t<title>$2</title>",

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

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

            "\t\t<script src=\"https://cdn.bootcss.com/vue/2.2.2/vue.min.js\"></script>",

            "\t</head>",

            "\t<body>",

            "\t$4",

            "<div id=\"app\">",

            "</div>",

            "<script>",

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

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

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

            "\t\t\t\t},",

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

                "\t\t\t\t}",

            "\t\t\t\t}",

            "\t\t\t)",

            "\t</script>",

            "\t</body>",

            "</html>"

            ],

        "description": "HTML - Defines a template for a html5 document",

        "scope": "text.html"

        },

        "html5-2": {// HTML文件

            "prefix": "html5",

            "body": [

                "<!DOCTYPE html>",

                "<html lang=\"$1zh-CN\">",

                "\t<head>",

                "\t\t<title>$2</title>",

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

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

                "\t\t<link href=\"$3css/style.css\" rel=\"stylesheet\">",

                "\t\t<script src=\"https://cdn.bootcss.com/vue/2.2.2/vue.min.js\"></script>",

                "\t</head>",

                "\t<body>",

                "\t$4",

                "<div id=\"app\">",

                "</div>",

                "\t</body>",

                "</html>"

                ],

            "description": "HTML - Defines a template for a html5 document",

            "scope": "text.html"

            },

}

猜你喜欢

转载自blog.csdn.net/xiajing13579/article/details/82660266