Browse Source

fix tabs bug

baiyaaaaa 8 years ago
parent
commit
8e761efbd6
1 changed files with 3 additions and 1 deletions
  1. 3 1
      packages/tabs/src/tabs.vue

+ 3 - 1
packages/tabs/src/tabs.vue

@@ -61,7 +61,9 @@
         this.$emit('input', value);
       },
       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('el-tab-pane');
+        }).indexOf(item.$vnode);
         this.panes.splice(index, 0, item);
       },
       removePanes(item) {