跟大家分享两种axios携带参数的方法(可用于前后端传值) :
A 相当于另起一个名字 ,可以在后台通过A获取到B
B 即将被携带的数据 , 常用 this.变量名
1 this.axios.post/get('url' , {params : {A : B}})
.then(res =>{}).catch({})
2 this.axios.post/get(`url?A=${B}`)
.then(res =>{}).catch(res=>{})
跟大家分享两种axios携带参数的方法(可用于前后端传值) :
A 相当于另起一个名字 ,可以在后台通过A获取到B
B 即将被携带的数据 , 常用 this.变量名
1 this.axios.post/get('url' , {params : {A : B}})
.then(res =>{}).catch({})
2 this.axios.post/get(`url?A=${B}`)
.then(res =>{}).catch(res=>{})
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。