Created
September 8, 2017 03:37
-
-
Save israeleriston/7f3942a669478cc778560b2bb1ea9194 to your computer and use it in GitHub Desktop.
Plugin for Vuejs inject http axios
This file contains 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 const http = axios.create({ baseURL: 'suaUrlAqui' }) | |
export default function install ( Vue ) { | |
Object.defineProperty(Vue.prototype, '$http', { | |
get: () => http | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment