This commit is contained in:
梁灏 2019-01-07 14:50:29 +08:00
parent c6de66168c
commit 68335adb6c

View file

@ -1,5 +1,5 @@
<template> <template>
<div :class="prefixCls" v-show="show"><slot></slot></div> <div :class="prefixCls" v-show="show" :style="contentStyle"><slot></slot></div>
</template> </template>
<script> <script>
const prefixCls = 'ivu-tabs-tabpane'; const prefixCls = 'ivu-tabs-tabpane';
@ -33,6 +33,13 @@
currentName: this.name currentName: this.name
}; };
}, },
computed: {
contentStyle () {
return {
visibility: this.$parent.activeKey !== this.currentName ? 'hidden' : 'visible'
};
}
},
methods: { methods: {
updateNav () { updateNav () {
this.$parent.updateNav(); this.$parent.updateNav();