Skip to content

Commit 8e761ef

Browse files
9125phzzzLeopoldthecoder
authored andcommitted
fix tabs bug
1 parent ce270fe commit 8e761ef

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

packages/tabs/src/tabs.vue

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,9 @@
6161
this.$emit('input', value);
6262
},
6363
addPanes(item) {
64-
const index = this.$slots.default.indexOf(item.$vnode);
64+
const index = this.$slots.default.filter(item => {
65+
return item.elm.nodeType === 1 && /\bel-tab-pane\b/.test('el-tab-pane');
66+
}).indexOf(item.$vnode);
6567
this.panes.splice(index, 0, item);
6668
},
6769
removePanes(item) {

0 commit comments

Comments
 (0)