[bugfix] Tab: title slot render (#1212)

This commit is contained in:
neverland
2018-05-31 17:58:59 +08:00
committed by GitHub
parent 3fa49cdd3e
commit 9b01710556
4 changed files with 82 additions and 38 deletions
+9
View File
@@ -1,6 +1,9 @@
<template>
<div :class="b('pane')" v-show="isSelected">
<slot v-if="inited" />
<div v-if="$slots.title" ref="title">
<slot name="title" />
</div>
</div>
</template>
@@ -45,6 +48,12 @@ export default create({
this.parent.tabs.push(this);
},
mounted() {
if (this.$slots.title) {
this.parent.renderTitle(this.$refs.title, this.index);
}
},
destroyed() {
this.parent.tabs.splice(this.index, 1);
}