1、axios是什么,axios有什么用?Vue是一个专注于网络请求的轻量级库。它用于发送请求,没有操作DOM的函数调用方法。1.axios.get(url).then(res=>{}).catch(err=>{})2.axios.post(url,data).then(res=>{}).catch(err=>{})注意success或者失败时用箭头函数声明回调函数,保证函数里面的this指向当前的vue实例对象。二、axios的使用方法1、导入包2.使用包get请求axios.get("http://www.xxxx.com/weffg_mini?city=sz").then(res=>{console.log(res)})。catch(err=>{console.log(err)})post请求axios.post("http://www.xxxx.com/weffg_mini?city=sz",{key:"dhfgahgfrghag",info:"dhfsajh"}).then(res=>{console.log(res)}).catch(err=>{console.log(err)})3.使用箭头函数保证this指向当前vue实例
