成人在线亚洲_国产日韩视频一区二区三区_久久久国产精品_99国内精品久久久久久久

您的位置:首頁技術(shù)文章
文章詳情頁

vue的$http的get請(qǐng)求要加上params操作

瀏覽:4日期:2022-10-31 11:09:41

vue GET傳遞參數(shù)要加上params

this.$http.get(’/operation/customer/question/edits’,{params:{id: 10}})

另外說一句,現(xiàn)在VUE官方推薦使用axios

vue-resource不更新了

補(bǔ)充知識(shí):vue請(qǐng)求中 post get傳參方式是不同的哦

我在學(xué)習(xí)vue,項(xiàng)目中post請(qǐng)求,get請(qǐng)求都用到了,我發(fā)現(xiàn)傳參方式是不一樣的。

post請(qǐng)求的例子:

checkin (){this.$http.post(’my url’,{mobilePhone:this.phone,password:this.password},{emulateJSON: true}).then(function(res){this.$root.userid=res.data.userid;console.log(this.$root.userid)this.$router.push(’/content’) ;});}

get請(qǐng)求的例子:

nextOne2 (){this.$http.get(’http://192.168.100.31:8080/wenchuang/guid/addProductFile’,{params: {filename:this.formData.chanpinjia,userid: this.$root.userid},},{emulateJSON: true}).then(function(res){this.step++;this.bianliang= res.data.files.id;});},

以上這篇vue的$http的get請(qǐng)求要加上params操作就是小編分享給大家的全部內(nèi)容了,希望能給大家一個(gè)參考,也希望大家多多支持好吧啦網(wǎng)。

標(biāo)簽: Vue
相關(guān)文章: