Ver código fonte

Merge pull request #1101 from Kingwl/master

Tabs: fix a 'activeName' attribute init bug
baiyaaaaa 8 anos atrás
pai
commit
73e9e918ae
1 arquivos alterados com 2 adições e 1 exclusões
  1. 2 1
      packages/tabs/src/tabs.vue

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

@@ -72,8 +72,9 @@
       }
     },
     mounted() {
+      this.currentName = this.activeName || this.$children[0].index || '1';
       this.$nextTick(() => {
-        this.currentName = this.activeName || this.$children[0].index || '1';
+        this.$forceUpdate();
       });
     },
     render(h) {