mirror of
https://github.com/youzan/vant.git
synced 2025-10-19 18:14:13 +00:00
[new feature] NumberKeyboard: add title-left slot (#3194)
This commit is contained in:
@@ -133,8 +133,11 @@ export default sfc({
|
||||
},
|
||||
|
||||
render(h) {
|
||||
const { theme, onPress, closeButtonText } = this;
|
||||
const { title, theme, onPress, closeButtonText } = this;
|
||||
|
||||
const titleLeftSlot = this.slots('title-left');
|
||||
const showTitleClose = closeButtonText && theme === 'default';
|
||||
const showTitle = title || showTitleClose || titleLeftSlot;
|
||||
|
||||
return (
|
||||
<transition name={this.transition ? 'van-slide-up' : ''}>
|
||||
@@ -146,9 +149,14 @@ export default sfc({
|
||||
onAnimationend={this.onAnimationEnd}
|
||||
onWebkitAnimationEnd={this.onAnimationEnd}
|
||||
>
|
||||
{(this.title || showTitleClose) && (
|
||||
{showTitle && (
|
||||
<div class={[bem('title'), 'van-hairline--top']}>
|
||||
<span>{this.title}</span>
|
||||
{titleLeftSlot && (
|
||||
<span class={bem('title-left')}>
|
||||
{titleLeftSlot}
|
||||
</span>
|
||||
)}
|
||||
{title && <span>{title}</span>}
|
||||
{showTitleClose && (
|
||||
<span class={bem('close')} onClick={this.onClose}>
|
||||
{closeButtonText}
|
||||
|
Reference in New Issue
Block a user