tabs icon indicating copy to clipboard operation
tabs copied to clipboard

Ability to add event to tabs to know which is open

Open richpollen opened this issue 7 years ago • 5 comments

Hi there - is there an easy way of tracking which tab is open? Id like to get the tab label when one is clicked - for GA tracking - is there a way to do that?

richpollen avatar Aug 24 '17 12:08 richpollen

.

Kuchiriel avatar Dec 29 '17 19:12 Kuchiriel

try @tab-selected="tabSelected"

nfer avatar Mar 12 '18 14:03 nfer

the emit codes:

    select (index) {
      this.$emit('tab-selected', index)
    }

then, you can get the current open tab index. trans the index to label in project codes.

nfer avatar Mar 12 '18 14:03 nfer

@nfer Could you explain in more detail please? I can't make it work.

Kuchiriel avatar May 11 '18 01:05 Kuchiriel

I couldn't use nfer's method but it's working for me like this :

<tabs ref="tabs" >
...
</tabs>

When I want to access to the selected index tab, I use :

const index = this.$refs.tabs.realSelectedIndex

ystreibel avatar Sep 07 '18 11:09 ystreibel