In many tutorials about VueJS I see this example:
import VueResource from 'vue-resource';
Vue.use(VueResource);
But in newly created Laravel 5.3 project I found only this code (bootstrap.js file):
window.Vue = require('vue');
require('vue-resource')
And found no "use" directive for vue-resource, but AJAX queries like this.$http.get() still work well. So, how Vue instance can use vue-resource?
vue-router
doesn't requireuse
ifVue
is declared globally. From the official docs:In laravel, you will see that
Vue
is declared globally by attaching it towindow
like so:So the
use
is not required.source: https://v2.vuejs.org/v2/guide/plugins.html#Using-a-Plugin