at-ui icon indicating copy to clipboard operation
at-ui copied to clipboard

Active tab

Open juanpprieto opened this issue 8 years ago • 5 comments

Hey guys,

Thanks for the great work. I've been playing around with the library and got stuck trying to activate a given tab pane on load. Is there a way to do this via props or should I just use the active tab class?

Thanks!

juanpprieto avatar Dec 15 '17 17:12 juanpprieto

sorry, i'm not very clear about your question.

You want to active custom tab via props? such like active Tab2 below?

<at-tabs>
  <at-tab-pane label="Tab1" name="name1">
    <p>Content of Tab Pane 1</p>
  </at-tab-pane>
  <at-tab-pane label="Tab2" name="name2">
    <p>Content of Tab Pane 2</p>
  </at-tab-pane>
  <at-tab-pane label="Tab3" name="name3">
    <p>Content of Tab Pane 3</p>
  </at-tab-pane>
</at-tabs>

koppthe avatar Dec 16 '17 06:12 koppthe

Hi there,

Yes, I would like to know how to programatically activate a given tab.

I've seen other frameworks exposing an 'active' prop to do this.

Any tips?

juanpprieto avatar Dec 18 '17 06:12 juanpprieto

Yes, it's in the docs, you can do two-way data binding by setting the v-model attribute in the at-tabs with the value of the name of one of the at-tab-pane's that are inside it

Thanks @diego-lipinski-de-castro that worked.

juanpprieto avatar Dec 26 '17 14:12 juanpprieto

This is not working anymore, what happened?