vue中axios不支持vue.use()方式声明使用。 所以有两种方法可以解决这点:
第一种: 在main.js中引入axios,然后将其设置为vue原型链上的属性,这样在组件中就可以直接 this.axios使用了
import axios from 'axios';
Vue.prototype.axios=axios;
components:
this.axios({
url:a.xxx,
method:'post',
data:{
id:3,
name:'jack'
}
})
.then(function(res)