1.安装npm install vue-resource --save-dev

vue http请求 vue-resource

2.重新 npm run dev

3.在main.js中引入(全局配置完后;你可以在任何一个组件中使用http请求)

vue http请求 vue-resource

我们来提供一个网站做下测试

提供请求的网站接口http://jsonplaceholder.typicode.com/users

vue http请求 vue-resource

 

vue http请求 vue-resource

vue http请求 vue-resource

vue http请求 vue-resource

vue http请求 vue-resource

vue http请求 vue-resource

 

相关文章: