mirror of
https://gitee.com/vant-contrib/vant.git
synced 2025-04-06 03:57:59 +08:00
fix(NavBar): Component renders blank left/right. (#7376)
This commit is contained in:
parent
dab89fe86e
commit
3664659240
@ -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);
|
||||
},
|
||||
|
@ -3,9 +3,7 @@
|
||||
exports[`placeholder prop 1`] = `
|
||||
<div class="van-nav-bar__placeholder" style="height: 50px;">
|
||||
<div class="van-nav-bar van-nav-bar--fixed van-hairline--bottom">
|
||||
<div class="van-nav-bar__left"></div>
|
||||
<div class="van-nav-bar__title van-ellipsis"></div>
|
||||
<div class="van-nav-bar__right"></div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
@ -20,8 +18,6 @@ exports[`render left & right slot 1`] = `
|
||||
|
||||
exports[`render title slot 1`] = `
|
||||
<div class="van-nav-bar van-hairline--bottom">
|
||||
<div class="van-nav-bar__left"></div>
|
||||
<div class="van-nav-bar__title van-ellipsis">Custom Title</div>
|
||||
<div class="van-nav-bar__right"></div>
|
||||
</div>
|
||||
`;
|
||||
|
Loading…
x
Reference in New Issue
Block a user