I have two separate vue files:- for example 1.vue and 2.vue and a main js file.
I have a variable xyz under window.App data: method in main.js
I want to access this variable as a share data variable how will I use it in my both the vue files. for example 1.vue will put some data under this variable and 2.vue will access this data.
window.App = new Vue({ el: '#app', data: { xyz: {} },and 1.vue put data in xyz and 2.vue use it .. I dont understand how to create a method in 1.vue to access this variableAppis global does not mean itsdatashould be treated as global. It should not. Encapsulation is important. Components should not depend on things that are external to them.