1.code-->首选项--->用片段
2 .新建片段
3.写入下面内容
"http-get请求": {
"prefix": "httpget",
"body": [
"this.\\$http({",
"url: this.\\$http.adornUrl(''),",
"method: 'get',",
"params: this.\\$http.adornParams({})",
"}).then(({data}) => {",
"})"
],
"description": "httpGET请求"
},
"http-post请求": {
"prefix": "httppost",
"body": [
"this.\\$http({",
"url:this.\\$http.adornUrl(''),",
"method: 'post',",
"data: this.\\$http.adornData(data, false)",
"}).then(({ data }) => { });"
],
"description": " httpPOST请求"
}
4.代码里面使用输入httppost或httpget
this.$http({
url: this.$http.adornUrl(''),
method: 'get',
params: this.$http.adornParams({})
}).then(({data}) => {
})
this.$http({
url:this.$http.adornUrl(''),
method: 'post',
data: this.$http.adornData(data, false)
}).then(({ data }) => { });