2
On app.js, use
window.axios = require("axios");
// instead of
import axios from 'axios';
Vue.use(axios);
on Vue files, use like this:
axios.get(...)
3
Inside app.js add this line of code:
Vue.prototype.axios = axios;
After this statement, you can use this.axios
inside every Vue component
Source:stackexchange.com