Commit 68335adb6c65457e36c1b094b4e6546f4a877173
1 parent
c6de6616
fix #5111 , close #5137
Showing
1 changed file
with
8 additions
and
1 deletions
Show diff stats
src/components/tabs/pane.vue
1 | <template> | 1 | <template> |
2 | - <div :class="prefixCls" v-show="show"><slot></slot></div> | 2 | + <div :class="prefixCls" v-show="show" :style="contentStyle"><slot></slot></div> |
3 | </template> | 3 | </template> |
4 | <script> | 4 | <script> |
5 | const prefixCls = 'ivu-tabs-tabpane'; | 5 | const prefixCls = 'ivu-tabs-tabpane'; |
@@ -33,6 +33,13 @@ | @@ -33,6 +33,13 @@ | ||
33 | currentName: this.name | 33 | currentName: this.name |
34 | }; | 34 | }; |
35 | }, | 35 | }, |
36 | + computed: { | ||
37 | + contentStyle () { | ||
38 | + return { | ||
39 | + visibility: this.$parent.activeKey !== this.currentName ? 'hidden' : 'visible' | ||
40 | + }; | ||
41 | + } | ||
42 | + }, | ||
36 | methods: { | 43 | methods: { |
37 | updateNav () { | 44 | updateNav () { |
38 | this.$parent.updateNav(); | 45 | this.$parent.updateNav(); |