<b-tab> Extending component causes b-tab to stop working
See original GitHub issueHeya,
I am trying to create a custom tab component to incorporate extra components and reduce duplicate code.
Sadly, whenever I try to use extends or mixins with the tab component, the tab navigation stops working.
Steps to reproduce the bug
- Create a custom component:
<template>
<b-tab v-bind="$props">
<slot></slot>
<pagination v-if="pagination"
:total-rows="pagination.totalRows"
:per-page="pagination.limit">
</pagination>
</b-tab>
</template>
<script>
import Tab from 'bootstrap-vue/es/components/tabs/tab';
import Pagination from '@/components/Pagination.vue';
export default {
name: 'Tab',
extends: Tab,
components: {
Pagination,
},
props: {
...Tab.props,
pagination: false
}
}
</script>
- Create a component that incorporates our element within a
<b-tabs>element. - Click on the tab header
- No
tab-contentis visible
Expected behavior
That the tab works just like a normal tab and makes the correct tab-content visible.
Versions
Libraries:
- BootstrapVue: 2.0.0-rc.19
- Bootstrap: 4.3.1
- Vue: 2.6.10
Environment:
- OS: Any (Fedora, Mac OS, Windows)
- Browser: Chrome
- Version: Chrome 74.0.3729.131
Additional context
I have used the example of the b-button from here
Issue Analytics
- State:
- Created 4 years ago
- Comments:13 (9 by maintainers)
Top Results From Across the Web
Tabs | Components - BootstrapVue
Create a widget of tabbable panes of local content. The tabs component is built upon navs and cards internally, and provides full keyboard...
Read more >aura - Extending Lightning Components not working
It can have different values at each level of component extension to enable different output from each component in the inheritance chain.
Read more >The MUMmer 3 manual - SourceForge
Using a seed and extend strategy, other parts of the MUMmer pipeline use these exact matches as alignment anchors to generate pair-wise alignments...
Read more >DoD Instruction 1010.16, Technical Procedures for the Military ...
(3) Biochemical Testing Advisory Board (BTAB). ... measures to maximize the use of facilities and equipment by expanding work schedules and.
Read more >Analog TDS Sensor - DFRobot WIKI
The probe can not be used in water above 55 degrees centigrade. ... int iFilterLen) { int bTab[iFilterLen]; for (byte i = 0;...
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 Free
Top 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

@Pidz-b Version 2.0.0-rc.23 has been released.
@Pidz-b Here is a solution that may work, although the detection routine that scans the DOM after mount for tabs tries to get the b-tab instances from the element reference (i.e.
el.__vue__), so thre is a chance it may not detect the b-tab instances after mount (since you are adding an extra layer in the component parent stack)This might be close, but we may need to alter the detection routine a bit to handle the case of the tab being nested inside another component.
EDIT: the new updated tab detection routine in PR #3442 should make this example work
The problem with extending
BTabwould be the registration of the child tab’s with the parentb-tabscomponent, as having a childb-tabin your render would make two tabs get registered (your extendedb-taband the nestedb-tab, the latter being the one that needs to be registered withb-tabs). You would need to override the injection in your extended component options:EDIT 2: With a minor tweak in the
b-tabschildb-tabdetection routine, the aboveinjectoverride is no longer needed (but wont hurt).