1、需要安装 vue-resource模块 注意加上--save
npm install vue-resource --save

2、main.js 引入vue-resource
import VueResource from 'vue-resource';

3、Vue.use(VueResource);

4、在组件里面直接使用
this.$http.get('url').then(function(res){},function(){err})

相关文章:

  • 2021-12-13
  • 2021-06-06
  • 2022-12-23
  • 2021-11-10
  • 2022-12-23
  • 2021-05-08
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2022-02-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-12-28
相关资源
相似解决方案