Commit 420ef343497888ca6fca3f6b73fb02e700072328
1 parent
ee975cd4
fixed #155
fixed #155
Showing
3 changed files
with
16 additions
and
8 deletions
Show diff stats
src/components/tabs/pane.vue
... | ... | @@ -28,9 +28,6 @@ |
28 | 28 | show: true |
29 | 29 | }; |
30 | 30 | }, |
31 | - computed: { | |
32 | - | |
33 | - }, | |
34 | 31 | methods: { |
35 | 32 | updateNav () { |
36 | 33 | this.$parent.updateNav(); |
... | ... | @@ -46,6 +43,9 @@ |
46 | 43 | disabled () { |
47 | 44 | this.updateNav(); |
48 | 45 | } |
46 | + }, | |
47 | + ready () { | |
48 | + this.updateNav(); | |
49 | 49 | } |
50 | 50 | }; |
51 | 51 | </script> | ... | ... |
src/components/tabs/tabs.vue
test/routers/tabs.vue
1 | 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 | 4 | <tab-pane label="标签一" key="key1">标签一的内容</tab-pane> |
4 | 5 | <tab-pane label="标签二" key="key2">标签二的内容</tab-pane> |
5 | 6 | <tab-pane label="标签三" key="key3">标签三的内容</tab-pane> |
7 | + <tab-pane label="标签四" key="key4" v-if="more">标签四的内容</tab-pane> | |
6 | 8 | </Tabs> |
7 | 9 | </template> |
8 | 10 | <script> |
9 | 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 | 23 | </script> | ... | ... |