mirror of
https://github.com/youzan/vant.git
synced 2025-10-21 03:11:15 +00:00
chore(Tab): optimize implementation of title slot (#4974)
This commit is contained in:
@@ -41,20 +41,10 @@ export default createComponent({
|
||||
}
|
||||
},
|
||||
|
||||
mounted() {
|
||||
if (this.slots('title')) {
|
||||
this.parent.renderTitle(this.$refs.title, this.index);
|
||||
}
|
||||
},
|
||||
|
||||
render(h) {
|
||||
const { slots, isActive } = this;
|
||||
const shouldRender = this.inited || !this.parent.lazyRender;
|
||||
const Content = [shouldRender ? slots() : h()];
|
||||
|
||||
if (slots('title')) {
|
||||
Content.push(<div ref="title">{slots('title')}</div>);
|
||||
}
|
||||
const Content = shouldRender ? slots() : h();
|
||||
|
||||
if (this.parent.animated) {
|
||||
return (
|
||||
|
Reference in New Issue
Block a user