Skip to content

Instantly share code, notes, and snippets.

@logaretm
Last active October 23, 2018 09:55
Show Gist options
  • Star 4 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save logaretm/56126af5867e391ea9507b462259caf3 to your computer and use it in GitHub Desktop.
Save logaretm/56126af5867e391ea9507b462259caf3 to your computer and use it in GitHub Desktop.
Axios plugin to replace vue-resource
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