Last active
October 23, 2018 09:55
-
-
Save logaretm/56126af5867e391ea9507b462259caf3 to your computer and use it in GitHub Desktop.
Axios plugin to replace vue-resource
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import axios from 'axios'; | |
export default (Vue) => { | |
Object.defineProperties(Vue.prototype, { | |
$http: { | |
get() { | |
return axios; | |
} | |
} | |
}); | |
}; | |
// Usage | |
// import plugin from './axiosPlugin.js'; | |
// Vue.use(axiosPlugin); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment