Axios是怎么添加get参数的?我的this.$http是Axios:varparams={wechat_num:this.search_data.search_wechat,telephone_num:this.search_data.search_phone,remark:this.search_data.search_remark}this.$http.get('/list/',params).then(response=>{this.wechatNumberData=response.data.resultsthis.$Message.success("搜索成功")}).catch(response=>{})这里的params执行在这里的数据是:{wechat_num:"009",telephone_num:null,remark:null}我使用:this.$http.get(this.$Urls.wx_numbers.list(),params)去调用请求。那么请问下,请求是会怎么样呢?会变为:/list/?wechat_num=009&telephone_num=null&remark=null吗?这个是我的希望的结果。可是貌似得到的不是这样子。如果能这样就最好不过:/list/?wechat_num=009
2 回答
翻翻过去那场雪
TA贡献2065条经验 获得超14个赞
我查看了文档:https://www.kancloud.cn/yunye...这里get的传参数应该是这样:axios.get('/user',{params:{ID:12345}}).then(function(response){console.log(response);}).catch(function(error){console.log(error);});所以传参应该加{params:params}
添加回答
举报
0/150
提交
取消
