What I try to do is that when the onUpdate function is executed in component 2, the sort function is executed in component 1.
COMPONENT 1
var container = new Vue({
el: "#main",
data: {
list:[{name:"John"},
{name:"Joao"},
{name:"Jean"} ],
},
methods:{
sort: function(){
alert("Hola desde otro componente")
}
,
}
});
COMPONENT 2
var list = document.getElementById("main");
Sortable.create(list, {
/* options */
animation: 200, // ms, animation speed
ghostClass: "ghost",
scroll: true,
onUpdate: function (){
this.componenet1.sort();
},
}); // That's all.