feat(Calendar): add show-subtitle prop (#5779)

This commit is contained in:
chenjiahan
2020-03-09 20:55:20 +08:00
parent e575bb4bb1
commit 17ecc980a7
9 changed files with 64 additions and 23 deletions
+9 -4
View File
@@ -77,6 +77,10 @@ export default createComponent({
type: Boolean,
default: true,
},
showSubtitle: {
type: Boolean,
default: true,
},
safeAreaInsetBottom: {
type: Boolean,
default: true,
@@ -93,7 +97,7 @@ export default createComponent({
data() {
return {
monthTitle: '',
subtitle: '',
currentDate: this.getInitialDate(),
};
},
@@ -239,7 +243,7 @@ export default createComponent({
/* istanbul ignore else */
if (currentMonth) {
this.monthTitle = currentMonth.title;
this.subtitle = currentMonth.title;
}
},
@@ -389,7 +393,8 @@ export default createComponent({
<Header
title={this.title}
showTitle={this.showTitle}
monthTitle={this.monthTitle}
subtitle={this.subtitle}
showSubtitle={this.showSubtitle}
scopedSlots={{
title: () => this.slots('title'),
}}
@@ -410,11 +415,11 @@ export default createComponent({
return (
<Popup
round
closeable
class={bem('popup')}
value={this.value}
round={this.round}
position={this.position}
closeable={this.showTitle || this.showSubtitle}
getContainer={this.getContainer}
closeOnPopstate={this.closeOnPopstate}
closeOnClickOverlay={this.closeOnClickOverlay}