国产成人精品亚洲777人妖,欧美日韩精品一区视频,最新亚洲国产,国产乱码精品一区二区亚洲

您的位置:首頁技術文章
文章詳情頁

vue的$http的get請求要加上params操作

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

vue GET傳遞參數要加上params

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

另外說一句,現在VUE官方推薦使用axios

vue-resource不更新了

補充知識:vue請求中 post get傳參方式是不同的哦

我在學習vue,項目中post請求,get請求都用到了,我發現傳參方式是不一樣的。

post請求的例子:

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請求的例子:

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請求要加上params操作就是小編分享給大家的全部內容了,希望能給大家一個參考,也希望大家多多支持好吧啦網。

標簽: Vue
相關文章:
主站蜘蛛池模板: 建宁县| 寻甸| 洞头县| 尼木县| 新密市| 鱼台县| 扬中市| 深州市| 金川县| 宜良县| 玛曲县| 龙泉市| 黄龙县| 蒙城县| 河津市| 资阳市| 镇沅| 涞源县| 凤阳县| 海丰县| 高台县| 通道| 江油市| 周口市| 连平县| 德阳市| 武安市| 上犹县| 万安县| 鄯善县| 兴宁市| 阳泉市| 盘山县| 和硕县| 延庆县| 宜兰市| 乌海市| 油尖旺区| 罗田县| 广州市| 彭阳县|