跟大家分享兩種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刪除。