[Vuejs]-Problems rendering main.js of Vue.js

0👍

You have already created a Vue instance that you can use across your project components.

Docs explain in really well:

A Vue application consists of a root Vue instance created with new Vue, optionally organized into a tree of nested, reusable components.

The problem you have is that you are trying to access the data value directly from main.js to an outside component (page.vue). You should pass the data from your main.js through properties.

You may want to see the a working example, I have added line comments on the sandbox to guide you.

Please take a look to it

Edit Vue Template

Leave a comment