When I used the get method before, I always subconsciously spliced the parameters on the link. Recently I heard that when using the get method of vue-resource, I can directly pass the parameters like a post. I couldn't find the document address and wanted to take a leave directly. Now, how should this parameter be passed?
The following method I used does not work~
let arg = {search: 'haha'}
this.$http.get(link, arg, {
...
}
女神的闺蜜爱上我2017-06-15 09:25:35
getInfo(){
const params = {partnerId: partnerId, openId: openId}
this.$http.get(commonUrl + "/restful/member2?op=get", {params:params}).then(response => {
console.log(response)
if (response.data.errcode === 0) {
this.dataInfo = response.data
} else {
// this.$router.push({path: '/Register'})
}
Indicator.close()
}, response => {
});
},
Like this. . . For reference only
Now vue is more recommended to use axios
axios.get('/user', {
params: {
ID: 12345
}
})
.then(function (response) {
console.log(response);
})
.catch(function (error) {
console.log(error);
});
This should be what you want~