1、打开vscode>文件>首选项>用户代码片断>vue.json
2、编写代码块 其中一行一句;$1是占位符,就是你能够输入的地方。
"http get": {
"prefix": "gg",//唤醒代码块的命令
"body": [
"this.$http.get('$1').then(",
" function successCallback(res) {",
" console.log(res);",
"},function errorCallback(err) {",
" console.log(err);",
"}",
");",
"$0"
], //代码块的主体
"description": "http get"//代码块的介绍
}
3、保存以后,打开任意vue文件输入 gg 就能够在提示框里看到,选中回车。
效果:vue