What exactly is the difference between using window.app and const app in main.js within Vue?
import question from './components/Questions.vue';
Vue.http.headers.common['X-CSRF-TOKEN'] = window.Laravel.csrfToken;
window.App = new Vue({
el: '#app',
components: { question }
});
as opposed to
import question from './components/Questions.vue';
Vue.http.headers.common['X-CSRF-TOKEN'] = window.Laravel.csrfToken;
const app = new Vue({
el: '#app',
components: { question }
});
I decided to use window.app because I needed to call a method from the question component using an external jQuery function to execute the Vue method, such as App.component.method(), which worked. But is this considered a safe approach?