先在当前项目文件夹下命令行安装插件
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
本文介绍如何通过命令行在项目中安装vue-resource插件,并提供了一个GET请求的示例代码,展示了如何使用此插件进行HTTP请求。
836

被折叠的 条评论
为什么被折叠?



