Blogger Information
Blog 26
fans 0
comment 0
visits 21460
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
axios的使用方式
default
Original
759 people have browsed it

axios的使用方式

  1. //get 方式
  2. axios.get('json/test.json').then(res=>{
  3. console.log(res.data)
  4. })
  1. post 表单提交方式
  2. axios.post('****','name='+this.name).then(res=>{
  3. console.log(res)
  4. })
  5. // 表单是 'name='+this.name+'&sex='+this.sex 这种拼接
  1. post JSON方式
  2. axios.post('****',{
  3. namethis.name,
  4. sex:this.sex
  5. }).then(res=>{
  6. console.log(res)
  7. })
  8. // json 是对象的方式 {name:this.name,sex:this.sex}
Statement of this Website
The copyright of this blog article belongs to the blogger. Please specify the address when reprinting! If there is any infringement or violation of the law, please contact admin@php.cn Report processing!
All comments Speak rationally on civilized internet, please comply with News Comment Service Agreement
0 comments
Author's latest blog post