@tttwb Try this instead:
window.app = new Vue({
mixins: [require('spark')]
});
Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.
This might be a silly question but how can I access the spark vue instance created in app.js?
For example in my app.js file I create a vue intstance:
var app = new Vue({
mixins: [require('spark')]
});
From examples I've seen online I should be able to type "app" in the console to access the Vue methods and data however I get the error:
VM37764:1 Uncaught ReferenceError: app is not defined(…)
I'm using vue-router and looking for a way to access the data/methods in a .vue component file but cannot find any answer online.
Does anyone know how I could go about this?
@tttwb Try this instead:
window.app = new Vue({
mixins: [require('spark')]
});
Please or to participate in this conversation.