29 lines
442 B
Vue
29 lines
442 B
Vue
<template>
|
|
<div v-show="isActive" class="my-tab-pane">
|
|
<slot></slot>
|
|
</div>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
name: 'MyTabPane',
|
|
props: {
|
|
label: String,
|
|
name: [String, Number],
|
|
disabled: Boolean,
|
|
closable: Boolean
|
|
},
|
|
computed: {
|
|
isActive() {
|
|
return this.$parent.activeName === this.name
|
|
}
|
|
},
|
|
mounted() {
|
|
this.$parent.registerPane(this)
|
|
},
|
|
beforeDestroy() {
|
|
this.$parent.unregisterPane(this)
|
|
}
|
|
}
|
|
</script>
|