I have a created a Vue instance and a global component. How can I call the component's method from my Vue instance?
In my Vue instance I did this:
methods: {
handleTabClick: function(tab, event) {
if (tab.name == 'log') {
call loadLog function in log component
}
}
}
Then my component is defined as this:
Vue.component('jettLog', {
props: ['shop'],
data() {
return {
log: [],
logLoading : true
}
},
methods: {
loadLog: function() {
console.log("Load");
},
},
});
How can I call jettLog's function loadLog
from handleTabClick()
?
I see different explanations and now I am wondering what's the best way to do it?
Thanks!