先在当前项目文件夹下命令行安装插件
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