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.

[b-tabs] v-model is immutable with dynamic tabs

See original GitHub issue

btabs

In summary:

  • Attach v-model to <b-tabs>. I.e: <b-tabs v-model="selectedPage">.
  • When creating a new tab (by i.e: clicking a button like in the DOCS), update the selectedPage to the length of the tabs content in order to set the active tab to the page that was just created.
  • Expect the corresponding tab for the new page to be selected. However, it isn’t.

Pseudo:

newPage () {
  this.tabs.push('Content')
  this.selectedPage = this.tabs.length - 1
}

However, if you hard code this.selectedPage to say 1, the active tab is indeed set.

Here’s a fiddle showcasing the issue: http://jsfiddle.net/mojvw303/10/

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Comments:8 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
mosinvecommented, Nov 20, 2017

Hi, you forget about Vue updating it’s vdom async. so this example should use nextTick.

0reactions
mosinvecommented, Nov 20, 2017

Just to check, try to use global nextTick… Vue.nextTick instead of component’s vm.$nextTick

Read more comments on GitHub >

github_iconTop Results From Across the Web

Vuetify tabs won't change when changing v-model
I am binding a variable to v-model and then changing that variable with the value I want. The point is, wheter the value...
Read more >
Tabs | Components - BootstrapVue
The tabs component is built upon navs and cards internally, and provides full keyboard navigation control of the tabs. For navigation based tabs...
Read more >
Disabled and Invisible Tabs | Nav | Vue Wijmo Demos
Invisible and disabled tabs cannot be selected by the user. This sample demonstrates disabling tabs and showing and hiding tabs. Learn about Wijmo...
Read more >
Performance | Vue.js
Overview #. Vue is designed to be performant for most common use cases without much need for manual optimizations. However, there are always...
Read more >
Strings - C# Programming Guide | Microsoft Learn
String; Declaring and initializing strings; Immutability of strings; Quoted string ... Immutability of strings ... \v, Vertical tab, 0x000B.
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