安装使用vue-reasource插件

先在当前项目文件夹下命令行安装插件

npm install vue-reasource 

在项目里直接引用即可


示例:

{
  // GET /someUrl
  this.$http.get('/someUrl').then(response => {

    // get body data
    this.someData = response.body;

  }, response => {
    // error callback
  });
}

参考官方文章:

https://github.com/pagekit/vue-resource/tree/master

猜你喜欢

转载自blog.csdn.net/abeeeee/article/details/77415892
今日推荐