question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

separate tab-content to external in b-tabs

See original GitHub issue

i want separate the .tab-content on <b-tabs> so inside <b-tabs> just a <b-tab> with a title
and .tab-content is outside the tags <b-tabs>

the standar from bootstrap-vue

<b-tabs content-class="mt-3">
    <b-tab title="First" active><p>I'm the first tab</p></b-tab>
    <b-tab title="Second"><p>I'm the second tab</p></b-tab>
    <b-tab title="Disabled" disabled><p>I'm a disabled tab!</p></b-tab>
</b-tabs>

the standar from bootstrap

<ul class="nav nav-tabs" id="myTab" role="tablist">
  <li class="nav-item">
    <a class="nav-link active" id="home-tab" data-toggle="tab" href="#home" role="tab" aria-controls="home" aria-selected="true">Home</a>
  </li>
  <li class="nav-item">
    <a class="nav-link" id="profile-tab" data-toggle="tab" href="#profile" role="tab" aria-controls="profile" aria-selected="false">Profile</a>
  </li>
  <li class="nav-item">
    <a class="nav-link" id="contact-tab" data-toggle="tab" href="#contact" role="tab" aria-controls="contact" aria-selected="false">Contact</a>
  </li>
</ul>
<div class="tab-content" id="myTabContent">
  <div class="tab-pane fade show active" id="home" role="tabpanel" aria-labelledby="home-tab">...</div>
  <div class="tab-pane fade" id="profile" role="tabpanel" aria-labelledby="profile-tab">...</div>
  <div class="tab-pane fade" id="contact" role="tabpanel" aria-labelledby="contact-tab">...</div>
</div>

so i want .tab-content separate and i can easy to customize with my template without removing the basic functionality of bootstrap-vue thanks

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

2reactions
Hiwscommented, Sep 2, 2019

You can simply add nav-wrapper-class="d-none" to your b-tabs, this will hide the controls and only show the content.

Then you can create your own controls somewhere else. I realise this the opposite of what you’re asking, but hope it’s enough for you to do what you’re trying to.

<b-dd text="Change tab" class="mb-3">
 <b-dd-item @click="tabIndex = 0">Page 1</b-dd-item>
 <b-dd-item @click="tabIndex = 1">Page 2</b-dd-item>
 <b-dd-item @click="tabIndex = 2">Page 3</b-dd-item>
 <b-dd-item @click="tabIndex = 3">Page 4</b-dd-item>
</b-dd>
  
<b-tabs id="myTabs" v-model="tabIndex" nav-wrapper-class="d-none">
 <b-tab>I'm the first tab</b-tab>
 <b-tab>I'm the second tab</b-tab>
 <b-tab>I'm the third tab</b-tab>
 <b-tab>I'm the fourth tab</b-tab>
</b-tabs>

<script>
new Vue({
 el: "#app",
 data: {
  tabIndex: 0
 }
});
</script>
0reactions
tmorehousecommented, Oct 12, 2019

@Tukizz if you want URLs to change, you should use <b-nav> instead of <b-tabs>. <b-tabs> is a widget which is not intended to change the URL of the page (as there could be multiple <b-tabs> on the same page).

See https://bootstrap-vue.js.org/docs/components/nav#card-integration for examples

Read more comments on GitHub >

github_iconTop Results From Across the Web

jquery - Is it possible to put the bootstrap tab-content outside ...
But i want it in different way. I have 2 paragraphs outside the bootstrap tab-panel and bootstrap tabs code below. i want class...
Read more >
CSS Trick: Tabs with consistent height - Observable
Sometimes you will have tabs with content of similar but not equal height, ... You might be tempted to just set a fixed...
Read more >
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 >
Navs and tabs · Bootstrap v5.1
The tab JavaScript swaps classes to control the content visibility and styling. You can use it with tabs, pills, and any other .nav...
Read more >
Build tabs for Teams - Microsoft Learn
Learn to build tabs, webpages embedded in Microsoft Teams. ... a channel inside a team, group chat, or personal app for an individual...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found