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

How to use custom values? #17

Open
moonlik opened this issue May 12, 2017 · 1 comment
Open

How to use custom values? #17

moonlik opened this issue May 12, 2017 · 1 comment

Comments

@moonlik
Copy link

moonlik commented May 12, 2017

Now to use this component I need to something like this:

<tabs v-on:tab-selected="changeTab" animation="slide" :only-fade="false">
  <tab-pane label="Day">Day Tab</tab-pane>
  <tab-pane label="Month">Month Tab</tab-pane>
  <tab-pane label="Year">Year Tab</tab-pane>
</tabs>
methods: {
  changeTab: function (tabNumber) {
    switch (tabNumber) {
      case 0:
        this.periodType = 'day'
        break

      case 1:
        this.periodType = 'month'
        break

      case 2:
        this.periodType = 'year'
        break

      default:
        this.periodType = 'day'
    }
  }
},

Is there any more convenient and flexible method to do it? For example, something like this:

<tabs v-model="periodType" animation="slide" :only-fade="false">
  <tab-pane label="Day" value="day">Day Tab</tab-pane>
  <tab-pane label="Month" value="month">Month Tab</tab-pane>
  <tab-pane label="Year" value="year">Year Tab</tab-pane>
</tabs>
@ghost
Copy link

ghost commented May 22, 2017

i think, if you use: .
you can try. But i dont know if it will work.

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

1 participant