diff --git a/src/calendar/README.md b/src/calendar/README.md index abd7efc2f..e9a200a58 100644 --- a/src/calendar/README.md +++ b/src/calendar/README.md @@ -305,10 +305,12 @@ Following props are supported when the type is multiple ### Slots -| Name | Description | -| ------ | ------------- | -| title | Custom title | -| footer | Custom fotter | +| Name | Description | SlotProps | +| ---------------------- | ------------------------- | ---------- | +| title | Custom title | - | +| footer | Custom footer | - | +| top-info `v2.12.22` | Custom top info of day | _day: Day_ | +| bottom-info `v2.12.22` | Custom bottom info of day | _day: Day_ | ### Methods diff --git a/src/calendar/README.zh-CN.md b/src/calendar/README.zh-CN.md index b0cc5919b..37925f87d 100644 --- a/src/calendar/README.zh-CN.md +++ b/src/calendar/README.zh-CN.md @@ -311,10 +311,12 @@ export default { ### Slots -| 名称 | 说明 | -| ------ | ------------------ | -| title | 自定义标题 | -| footer | 自定义底部区域内容 | +| 名称 | 说明 | 参数 | +| ---------------------- | ------------------------ | ---------- | +| title | 自定义标题 | - | +| footer | 自定义底部区域内容 | - | +| top-info `v2.12.22` | 自定义日期上方的提示信息 | _day: Day_ | +| bottom-info `v2.12.22` | 自定义日期下方的提示信息 | _day: Day_ | ### 方法 diff --git a/src/calendar/components/Month.js b/src/calendar/components/Month.js index d1d8cc45e..9704a40ea 100644 --- a/src/calendar/components/Month.js +++ b/src/calendar/components/Month.js @@ -266,8 +266,28 @@ export default createComponent({ ); }, + genTopInfo(item) { + const slot = this.$scopedSlots['top-info']; + if (item.topInfo || slot) { + return ( +