Element UI手册:https://cloud.tencent.com/developer/doc/1270
中文文档:http://element-cn.eleme.io/#/zh-CN
github地址:https://github.com/ElemeFE/element
中文文档:http://element-cn.eleme.io/#/zh-CN
github地址:https://github.com/ElemeFE/element
1:进入项目,npm安装
npm install axios --save

2.在main.js下引用axios
import axios from 'axios'

3:准备json数据
自己写了一个json数据,放在服务器上,现在要通过vue项目调用数据
http://www.intmote.com/test.json
4:跨域问题,设置代理,利用proxyTable属性实现跨域请求
在config/index.js 里面找到proxyTable :{} ,然后在里面加入以下代码

5:打开一个界面User.vue,开始写请求数据的方法
User.vue参考代码:
6:再次运行
npm run dev
这个时候,我们可以看见,请求的数据
原文作者:祈澈姑娘 技术博客:https://www.jianshu.com/u/05f416aefbe1