I have 2 vue variables. I want to set data for vue1 from vue2. What is the correct way to do it.
var vue1 = new Vue({
el: '#id1',
data: {
'name': 'Vue name'
},
methods: {
},
delimiters: ["[[", "]]"],
});
var vue2 = new Vue({
el: '#id2',
data: {
},
methods: {
func1:function (name) {
// Here i want to set vue1.name=name
vue1.name=name;
}
},
delimiters: ["[[", "]]"],
});
I have seen a function setData() but I dont know how to use it and if this is the correct scenario for that function.