Skip to content

Commit 02d4304

Browse files
authored
Fix error when removing the active tab
1 parent ba45aa3 commit 02d4304

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/components/VueTabs.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -190,7 +190,11 @@ export default {
190190
watch: {
191191
tabs (newList) {
192192
if (newList.length > 0 && !this.value) {
193-
this.activateTab(this.activeTabIndex)
193+
if (newList.length <= this.activeTabIndex) {
194+
this.activateTab(this.activeTabIndex - 1);
195+
} else {
196+
this.activateTab(this.activeTabIndex);
197+
}
194198
}
195199
if (newList.length > 0 && this.value) {
196200
this.findTabAndActivate(this.value)

0 commit comments

Comments
 (0)