I'm defining the Vue.js instance like this in app.js:
const vm = new Vue({
el: '#app',
data: {
page: 'welcome'
}
});
and using Laravel's default webpack script:
mix.js('resources/assets/js/app.js', 'public/js')
.sass('resources/assets/sass/app.scss', 'public/css');
Vue is loading correctly as the components are displaying and the Vue developer plugin is showing appropriate data.
However, in the developer console and in scripts on the page vm is not defined.
For instance on the page that is loading a Vue component
<script>
console.log(vm); // Error: vm is not defined.
</script>
How do I access the Vue instance? I want to set a one of its data properties.