b-tabs: be able to get active tab title
See original GitHub issueIs your feature request related to a problem? Please describe…
Hi, we need to load a component only when a b-tab is active. A solution to do this would be
<b-tabs v-model="tabIndex" >
<b-tab title="abc">...</b-tab>
...
<b-tab title="xyz">
<my-component v-if="tabIndex == 7"></my-component>
</b-tab>
Problem: The number of tabs vary dynamically, and we can’t tell at runtime which number is the proper tabIndex. But we know the title is “xyz”
Request: Be able to get the active tab title from tabIndex, or have another way to determine the current tab title.
Describe the solution you’d like
<b-tabs @change="tabChange" >
tabChange(e) never triggers. Would expect that to trigger and have the index & title in event properties.
OR
<b-tabs ref="tabs" >
and have something like this.$refs.tabs.getTitle(tabIndex)
Issue Analytics
- State:
- Created 4 years ago
- Comments:7 (7 by maintainers)
Top Results From Across the Web
Tabs | Components - BootstrapVue
If you want to add custom content to tab title, like HTML code, icons, or another non-interactive Vue component, this possible by using...
Read more >"react-tabs" is there any way to get the text of the active tab (or ...
Was just going through react tabs, instead of onClick , use can use, focusTabOnClick and pass state accordingly .
Read more >Expose Current Tab Title - Feedback and Feature Requests
Expose Current Tab Title. At the moment, you can't get the currently active tab with code, the Title property of the tabs is...
Read more >chrome.tabs - Chrome Developers
# Get the current tab. This example demonstrates how an extension's service worker can retrieve the active tab from the currently-focused window (or...
Read more >Working with the Tabs API - Mozilla - MDN Web Docs
"tabs" permission is needed to access the Tab.url , Tab.title ... Where you want information about the current tab only, you can get...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
One can also make individual
<b-tab>
components lazy via thelazy
prop, which when set doesn’t mount the content of the<b-tab>
until it is shown/activated, and will be un-mounted when the tab is deactivated/hidden.https://bootstrap-vue.js.org/docs/components/tabs#comp-ref-b-tab
One can also make all tab’s lazy by setting the lazy prop on the parent
<b-tabs>
componenthttps://bootstrap-vue.js.org/docs/components/tabs#comp-ref-b-tabs
@tmorehouse I made a pull request. It’s mainly with your explanatory comment 😃