I have 3 Components. App.vue, Header.vue and Example.vue
App.vue is my Parent component. Header.vue and Example.vue is my child components.
My Header.vue created() method :
created()
{
socket.on('notification', data => {
console.log('Header Page');
});
}
My Example.vue created() method :
created()
{
socket.on('notification', data => {
console.log('Example Page');
});
}
When page rendered, i see only "Example Page" at console. Only the last event is triggered when the event has the same name.
This is simple example. I use Vue Router and use socket only App.vue. For different operations, i check router name. It is very diffucult and complicated.
I want use different operations with same event name at different components.
I want output like this :
Header Page
Example Page