Home

Issue: 849

Event handling in different components ($emit and $on)

[issue link]

I have a very simple use case.
Emit an event in one component and listen to that event in another component.
In component1’s methods block, I am using this piece of code

this.$emit('deletedchip')

In component2’s mounted block, I am using this piece of code

this.$on('deletedchip', function(){
//Do something
}) 

Event is being emitted but the listener part in component2 is not working. Is there any specific way of dealing this in nuxtjs ?

This question is available on Nuxt.js community (#c728)