vue-resource前后端请求

vue 有自己的请求机制,即vue-resource

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

1
2
3
4
5
6
7
8
9
<script src="https://cdn.jsdelivr.net/vue.resource/1.0.3/vue-resource.min.js"></script>
{
// GET or POST
this.$http.get('url').then((response) => {
// success callback
}, (response) => {
// error callback
})
}