Vue使用this.$http.get 和 this.$http.post传参
两种传参方式是不同的get:getInfo(){console.log(this.page)this.$http.get('http://localhost:8080/resourceController/requestResourceListData',{params:{page:this.page,rows:this.rows}},{emulate...
·
两种传参方式是不同的
get:
getInfo(){
console.log(this.page)
this.$http.get('http://localhost:8080/resourceController/requestResourceListData',{params:{page:this.page,rows:this.rows}},{
emulateJSON:true
}).then(result =>{
console.log(result.body.rows)
this.list=result.body.rows
})
}
post:
getInfo(){
console.log(this.page)
this.$http.post('http://localhost:8080/resourceController/requestResourceListData',{page:this.page,rows:this.rows},{
emulateJSON:true
}).then(result =>{
console.log(result.body.rows)
this.list=result.body.rows
})
}
更多推荐
已为社区贡献1条内容
所有评论(0)