axios常见问题解决

Axios.all is not a function inside vue component

报错为Axios.all不是vue组件内的函数

原因

request.js返回的axios实例不是axios本身。axios 实例方法172 不包括all()

解决办法

除了request暴露的axios实例
额外增加一个http
import http from "axios";
Vue.prototype = Object.assign(Vue.prototype, {
  $http: http,
});
原文地址:https://www.cnblogs.com/cjh1996/p/12785651.html