当前位置:首页>开发>正文

vue脚手架axios用post请求后台数据的格式是怎样的 vue3.0脚手架为什么一引入iview就报错

2023-04-25 03:20:13 互联网 未知 开发

 vue脚手架axios用post请求后台数据的格式是怎样的 vue3.0脚手架为什么一引入iview就报错

vue脚手架axios用post请求后台数据的格式是怎样的?

你可以直接用post方法,这样就不用填写method这个参数了,也可以像我这样使用,下面是我的代码例子,希望对你有所帮助:
click2(){
this.axios({
/*headers: {Authorization: bearer this.$store.state.users.currentUser.UserToken},*/
method: post,
url: /test,
data: {
"test": "123456"
}
}).then(function(response){
/*console.log(response)*/
this.value = response.data
}.bind(this)).catch(function(error){
console.log(error)
})
}

vue3.0脚手架为什么一引入iview就报错

ue的ui框架iview一定要配合webpack用吗?webpack iview vue.js新...新手真心吐槽一下,iview的脚手架工具用npm run init各种报错,官方也不指导一下...天津众 维原画设计提供

最新文章