Skip to content

How to use custom values? #17

Open
@moonlik

Description

@moonlik

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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions