diff --git a/src/calendar/README.md b/src/calendar/README.md index e1222d6c3..634c3f56a 100644 --- a/src/calendar/README.md +++ b/src/calendar/README.md @@ -249,6 +249,7 @@ Set `poppable` to `false`, the calendar will be displayed directly on the page i | round | Whether to show round corner | *boolean* | `true` | | show-mark | Whether to show background month mark | *boolean* | `true` | | show-title `v2.5.5` | Whether to show title | *boolean* | `true` | +| show-subtitle `v2.5.5` | Whether to show subtitle | *boolean* | `true` | | show-confirm | Whether to show confirm button | *boolean* | `true` | | close-on-popstate `v2.4.4` | Whether to close when popstate | *boolean* | `false` | | close-on-click-overlay | Whether to close when click overlay | *boolean* | `true` | diff --git a/src/calendar/README.zh-CN.md b/src/calendar/README.zh-CN.md index e05d2d430..bac44258e 100644 --- a/src/calendar/README.zh-CN.md +++ b/src/calendar/README.zh-CN.md @@ -251,6 +251,7 @@ export default { | round | 是否显示圆角弹窗 | *boolean* | `true` | | show-mark | 是否显示月份背景水印 | *boolean* | `true` | | show-title `v2.5.5` | 是否展示日历标题 | *boolean* | `true` | +| show-subtitle `v2.5.5` | 是否展示日历副标题(年月) | *boolean* | `true` | | show-confirm | 是否展示确认按钮 | *boolean* | `true` | | close-on-popstate `v2.4.4` | 是否在页面回退时自动关闭 | *boolean* | `false` | | close-on-click-overlay | 是否在点击遮罩层后关闭 | *boolean* | `true` | diff --git a/src/calendar/components/Header.js b/src/calendar/components/Header.js index 772055f4e..b10a6d2b9 100644 --- a/src/calendar/components/Header.js +++ b/src/calendar/components/Header.js @@ -6,22 +6,23 @@ const [createComponent] = createNamespace('calendar-header'); export default createComponent({ props: { title: String, + subtitle: String, showTitle: Boolean, - monthTitle: String, + showSubtitle: Boolean, }, methods: { genTitle() { - if (!this.showTitle) { - return; + if (this.showTitle) { + const title = this.slots('title') || this.title || t('title'); + return