mirror of
https://github.com/youzan/vant.git
synced 2026-05-02 01:01:43 +08:00
[bugfix] Tab: title slot render (#1212)
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user