C
C
cyberlain2021-08-04 17:47:44
Bootstrap
cyberlain, 2021-08-04 17:47:44

bootstrap vue. How to manage tabs when clicking external links?

Bootstrap-vue has a ready-made component with tabs .
Question: how to open/close tabs by clicking on links OUTSIDE b-tabs ?
What directive to write for

<b-link>Открыть таб у которого title="Second"</b-link>

so that the second tab opens (and the rest close accordingly)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
Y
Yuri, 2021-08-04
@cheeroque

b-tabs have v-model . Hang it on your tabs and by clicking on an external link, simply change it to the desired value.

<b-tabs v-model="tabIndex"> ... </b-tabs>
<b-link @click="tabIndex = 1">Change tab</b-link>

But this only works with the tab index, if you need to activate it by title, you will have to fence some kind of garden. I wouldn't suffer so much.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question