vue中axios的基本使用
挂载到vue构造函数的prototype上使用
import axios from 'axios'
import Vue from 'vue'
Vue.prototype.$http = axios
//后续new一个vue实例后,在.vue文件中可以通过this.$http 发起网路请求
创建axios实例使用
``` import axios from 'axios' import Vue from 'vue' Vue.prototype.$http = axios //后续new一个vue实例后,可以通过this.$http 发起网路请求

浙公网安备 33010602011771号