0
之前我安裝我的路由器我設立了一個全球性的Vue的實例,並使用VUE資源是這樣的:如何將vue-resource與vue-router實例一起使用?
export const befriend = (recipient, event) => {
Vue.http.post('/route',{
// Data
}).then(function(response) {
// Success
}.bind(this), function(response) {
// Error
});
}
現在我的Vue的實例是由路由器本身這樣的實例:
router.start(App, 'body');
當我沒有綁定到我的實例的變量時,如何使用vue-resource?