mirror of https://github.com/ElemeFE/element
Tabs: fixed tab-pane's incorrect order (#12346)
parent
72349e1a62
commit
74e62819c0
|
@ -89,7 +89,9 @@
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
addPanes(item) {
|
addPanes(item) {
|
||||||
const index = this.$slots.default.indexOf(item.$vnode);
|
const index = this.$slots.default.filter(item => {
|
||||||
|
return item.elm.nodeType === 1 && /\bel-tab-pane\b/.test(item.elm.className) || item.elm.nodeType === 8;
|
||||||
|
}).indexOf(item.$vnode);
|
||||||
this.panes.splice(index, 0, item);
|
this.panes.splice(index, 0, item);
|
||||||
},
|
},
|
||||||
removePanes(item) {
|
removePanes(item) {
|
||||||
|
|
Loading…
Reference in New Issue