Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Enable v-tabs that were set disabled in Vue and Vuetify?

I have the following code for a v-tabs control:

</v-tabs>
  <v-tab
    disabled
    v-for="tab of tabs"
    :key="tab.index"
    v-on:change="tabSelected(tab.index)">
    {{tab.name}}
  </v-tab>
</v-tabs>

The tabs are disabled when the app starts. They are disabled until the user selects an item that will fill the tabs with data. Once the data is displayed the tabs need to become active. I would like to add code to a button click that gets the data and will also allow the tab to become active.

like image 232
Bill Avatar asked Nov 16 '25 11:11

Bill


1 Answers

Got it- I added binding to disabled

           <v-tab
            :disabled="isDisabled"
            v-for="tab of tabs"
            :key="tab.index"
            v-on:change="tabSelected(tab.index)"
          >{{tab.name}}</v-tab>
        </v-tabs>

Then on the button click

       this.isDisabled = false;
like image 122
Bill Avatar answered Nov 19 '25 00:11

Bill



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!