修复bug
This commit is contained in:
28
components/MyTabs/MyTabPane.vue
Normal file
28
components/MyTabs/MyTabPane.vue
Normal file
@ -0,0 +1,28 @@
|
||||
<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>
|
||||
Reference in New Issue
Block a user