一.axios (推荐)
步骤1:安装
cnpm install axios --save
步骤2:组件中引入
import Vue from 'vue'
import Axios from 'axios'
步骤3:项目中运用


二.vue.resource
步骤1:安装
cnpm install vue-resource --save
步骤2:在 main.js文件中 引入
import VueResource from 'vue-resource'
Vue.use(VueResource)
步骤3:在项目中运用

^_^ 一个在路上的前端小白,欢迎评论指正。
原文:https://blog.csdn.net/DOCALLEN/article/details/68926338
网友评论