fix(NavBar): Component renders blank left/right. (#7376)

This commit is contained in:
Callum
2020-10-22 11:56:17 +08:00
committed by GitHub
parent dab89fe86e
commit 3664659240
2 changed files with 12 additions and 8 deletions
+12 -4
View File
@@ -67,19 +67,27 @@ export default createComponent({
style={{ zIndex: this.zIndex }}
class={[bem({ fixed: this.fixed }), { [BORDER_BOTTOM]: this.border }]}
>
<div class={bem('left')} onClick={this.onClickLeft}>
{this.hasLeft() && <div class={bem('left')} onClick={this.onClickLeft}>
{this.genLeft()}
</div>
</div>}
<div class={[bem('title'), 'van-ellipsis']}>
{this.slots('title') || this.title}
</div>
<div class={bem('right')} onClick={this.onClickRight}>
{this.hasRight() && <div class={bem('right')} onClick={this.onClickRight}>
{this.genRight()}
</div>
</div>}
</div>
);
},
hasLeft() {
return this.leftArrow || this.leftText || this.slots('left');
},
hasRight() {
return this.rightText || this.slots('right');
},
onClickLeft(event) {
this.$emit('click-left', event);
},