最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

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

programmeradmin0浏览0评论

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 bee active. I would like to add code to a button click that gets the data and will also allow the tab to bee active.

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 bee active. I would like to add code to a button click that gets the data and will also allow the tab to bee active.

Share Improve this question edited Jan 4, 2023 at 23:26 Riza Khan 3,1705 gold badges28 silver badges63 bronze badges asked Nov 21, 2019 at 2:18 BillBill 1,4872 gold badges34 silver badges66 bronze badges
Add a ment  | 

1 Answer 1

Reset to default 4

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;
发布评论

评论列表(0)

  1. 暂无评论