Closed
Description
Describe the bug
Hi,
I'm not being able to define the initial selected tab. Even if I change the value onMounted, it is reset to 0.
This was working on 0.28.6, and is broken since 0.29.1.
bootstrapvuenext-v0.28.6...bootstrapvuenext-v0.29.1
<template>
<h3>selectedIndex: {{ selectedIndex }}</h3>
<BTabs v-model="selectedIndex">
<BTab title="0" />
<BTab title="1" />
<BTab title="2" />
<BTab title="3" />
<BTab title="4" />
</BTabs>
</template>
<script setup>
import { onMounted, ref, watch } from "vue";
import { BTab, BTabs } from "bootstrap-vue-next";
const selectedIndex = ref(3);
onMounted(() => {
selectedIndex.value = 3;
});
watch(
selectedIndex,
(val) => {
console.log("selectedIndex", val);
},
{ immediate: true }
);
</script>
Console output:
selectedIndex 3
selectedIndex 0
selectedIndex 3
selectedIndex 0
Reproduction
https://codesandbox.io/p/sandbox/ygkzlr
Used Package Manager
pnpm