I'm trying to figure out why my Vue instance's refs are undefined.
Using View.js from Laravel Project
Here you can see I instigate the Vue instance
(resources\assets\js\app.js):
import AutoPopulateSelect from './components/results-text/AutoPopulateSelect.vue';
const app = new Vue({
el: '#app',
components: { 'auto-populate-select': AutoPopulateSelect }
});
And this is where I actually use the component with the ref on it
(resources\views\results-text\edit.blade.php):
<auto-populate-select ref="models">Vehicle Models</auto-populate-select>
I have tried running app.$refs however this just returns undefined. I have done this from within the console so the application would of finished loading.
Edit:
Just noticed something string, if I run console.log(app.$refs); below where app is defined, so:
import AutoPopulateSelect from './components/results-text/AutoPopulateSelect.vue';
const app = new Vue({
el: '#app',
components: { 'auto-populate-select': AutoPopulateSelect }
});
console.log(app.$refs);
Then the ref is there! It appears to be when I attempt to do this from the console... does Laravel do something funky!?
app.console.log(window.app === app);Or be explicit with theappexposure and do something like:window.appWhyNotWork = new Vue.