7 months ago

Access Vue data outside of component

Posted 7 months ago by stemie

I'm trying to access Vue in another js file. Specifically I want to update the data. If I console.log(app) it tells me app is not defined but I've declared it as below in my resources/assets/js/app.js file

Vue.component('my-list', require('./components/myList.vue'));

const app = new Vue({
    el: '#vue-app'

Any ideas what I'm doing wrong?

Please sign in or create an account to participate in this conversation.