用vscode创建vue模版(vue+回车即为模版)
1.方法一:Ctrl+Shift+P打开命令输入 snippets; 在搜索框输入vue选择‘vue.json’。
2.方法二:文件 → 首选项 → 用户代码片段 → 在搜索框输入vue选择‘vue.json’。
修改vue.json为:
{
"Print to console": {
"prefix": "vue",
"body": [
"<template>",
" <div>\n",
" </div>",
"</template>\n",
"<script type=\"text/ecmascript-6\">",
"export default {",
" data() {",
" return {\n",
" }",
" },",
" components: {\n",
" }",
"}",
"</script>\n",
"<style scoped lang=\"less\">\n",
"</style>",
"$2"
],
"description": "Log output to console"
}
}
即:
![](https://img2018.cnblogs.com/blog/1286543/201903/1286543-20190312095123336-1753036919.png)