Commit 420ef343497888ca6fca3f6b73fb02e700072328

Authored by 梁灏
1 parent ee975cd4

fixed #155

fixed #155
src/components/tabs/pane.vue
@@ -28,9 +28,6 @@ @@ -28,9 +28,6 @@
28 show: true 28 show: true
29 }; 29 };
30 }, 30 },
31 - computed: {  
32 -  
33 - },  
34 methods: { 31 methods: {
35 updateNav () { 32 updateNav () {
36 this.$parent.updateNav(); 33 this.$parent.updateNav();
@@ -46,6 +43,9 @@ @@ -46,6 +43,9 @@
46 disabled () { 43 disabled () {
47 this.updateNav(); 44 this.updateNav();
48 } 45 }
  46 + },
  47 + ready () {
  48 + this.updateNav();
49 } 49 }
50 }; 50 };
51 </script> 51 </script>
src/components/tabs/tabs.vue
@@ -202,9 +202,6 @@ @@ -202,9 +202,6 @@
202 this.updateNav(); 202 this.updateNav();
203 } 203 }
204 }, 204 },
205 - compiled () {  
206 - this.updateNav();  
207 - },  
208 watch: { 205 watch: {
209 activeKey () { 206 activeKey () {
210 this.updateBar(); 207 this.updateBar();
test/routers/tabs.vue
1 <template> 1 <template>
2 - <Tabs active-key="key1"> 2 + <i-button @click="add">add</i-button>{{more}}
  3 + <Tabs active-key="key1" type="card" closable>
3 <tab-pane label="标签一" key="key1">标签一的内容</tab-pane> 4 <tab-pane label="标签一" key="key1">标签一的内容</tab-pane>
4 <tab-pane label="标签二" key="key2">标签二的内容</tab-pane> 5 <tab-pane label="标签二" key="key2">标签二的内容</tab-pane>
5 <tab-pane label="标签三" key="key3">标签三的内容</tab-pane> 6 <tab-pane label="标签三" key="key3">标签三的内容</tab-pane>
  7 + <tab-pane label="标签四" key="key4" v-if="more">标签四的内容</tab-pane>
6 </Tabs> 8 </Tabs>
7 </template> 9 </template>
8 <script> 10 <script>
9 export default { 11 export default {
10 - 12 + data () {
  13 + return {
  14 + more: false
  15 + }
  16 + },
  17 + methods: {
  18 + add () {
  19 + this.more = !this.more;
  20 + }
  21 + }
11 } 22 }
12 </script> 23 </script>