<div @ontabselected="sayHelloFromRoot">
<tabs>
<tab></tab>
<tab></tab>
</tabs>
</div>
I have set up an event listener called ontabselected
in the Tabs
component and I'm emitting it like this:
this.$emit('ontabselected', tab);
The method sayHelloFromRoot
is defined in the root Vue instance and all it does is log 'hello' to the console:
sayHelloFromRoot(){
console.log('hello');
}
When I switch between tabs, I can see the event being emitted in vue-devtools, but strangely, 'hello' is not printed in the console.