0👍
✅
You can try this:
created: function(){
bus.$on('content::event', this.compareTabID)
},
methods: {
compareTabID: function(tab_id){
if (tab_id == this.id){%do something%}
}
}
0👍
If you want to listen for an event on an active tab then you can find that tab using active class.
If this tab has active class then take action otherwise don’t.
Using id is also not a bad practice since ids are always unique.
If this answer doesn’t help then paste your more code to explain the situation.
Source:stackexchange.com