1. 程式人生 > >用vscode創建vue模版(vue+回車即為模版)

用vscode創建vue模版(vue+回車即為模版)

int 打開 log rsquo ext fault 分享 png component

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" } } 即: 技術分享圖片

用vscode創建vue模版(vue+回車即為模版)