Vscode新建vue模板

每次都需要写入相同的东西,很麻烦,可以利用vscode用户代码片段,然后提高效率

第一部

image.png

在用户代码片段搜索vue,在vue.json里面贴上下面的代码

{
    /*
    // Place your snippets for Vue 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"
    }
*/
    "Print to console": {
        "prefix": "vue",
        "body": [
            "\n",
            "\n",
            "",
            "$2"
        ],
        "description": "Log output to console"
    }
}

保存好

第二步

新建vue文件

在文件内输入vue,就有提示

QQ20180724-162211-HD.gif

个人微信号:2817062995
欢迎交流,记得加我备注:哦

你可能感兴趣的:(Vscode新建vue模板)