使用vue-resource请求数据的步骤
1、需要安装vue-resource模块 注意加上 --save
npm install vue-resource --save /cnpm install vue-resource --save
2、在main.js中引入vue-resource
3、在组件里面直接使用
this.$http.get(地址).then(function(){ })
例子: 获取请求的数据,把请求的数据输出到ul中。
使用vue-resource请求数据的步骤
1、需要安装vue-resource模块 注意加上 --save
npm install vue-resource --save /cnpm install vue-resource --save
2、在main.js中引入vue-resource
3、在组件里面直接使用
this.$http.get(地址).then(function(){ })
例子: 获取请求的数据,把请求的数据输出到ul中。