Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to add event to tabs to know which is open #21

Open
richpollen opened this issue Aug 24, 2017 · 5 comments
Open

Ability to add event to tabs to know which is open #21

richpollen opened this issue Aug 24, 2017 · 5 comments

Comments

@richpollen
Copy link

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?

@Kuchiriel
Copy link

.

@nfer
Copy link
Member

nfer commented Mar 12, 2018

try @tab-selected="tabSelected"

@nfer
Copy link
Member

nfer commented Mar 12, 2018

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.

@Kuchiriel
Copy link

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

@ystreibel
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants