diff --git a/src/calendar/README.md b/src/calendar/README.md
index 0879f3e1d..17dd06ee0 100644
--- a/src/calendar/README.md
+++ b/src/calendar/README.md
@@ -82,6 +82,14 @@ Set `show-confirm` to` false` to hide the confirm button. In this case, the `con
`range`表示选择日期区间 | *string* | `single` | - |
| title | 日历标题 | *string* | `日期选择` | - |
+| color | 颜色,对底部按钮和选中日期生效 | *string* | `#ee0a24` | - |
| min-date | 最小日期 | *Date* | 当前日期 | - |
| max-date | 最大日期 | *Date* | 当前日期的六个月后 | - |
| default-date | 默认选中的日期 | *Date \| Date[]* | 今天 | - |
diff --git a/src/calendar/components/Month.js b/src/calendar/components/Month.js
index 6a685a9ee..d9a0b65d8 100644
--- a/src/calendar/components/Month.js
+++ b/src/calendar/components/Month.js
@@ -8,6 +8,7 @@ export default createComponent({
props: {
date: Date,
type: String,
+ color: String,
minDate: Date,
maxDate: Date,
showMark: Boolean,
@@ -129,7 +130,7 @@ export default createComponent({
}
},
- getDayStyle(index) {
+ getDayStyle(type, index) {
const style = {};
if (index === 0) {
@@ -140,6 +141,14 @@ export default createComponent({
style.height = `${this.rowHeight}px`;
}
+ if (this.color) {
+ if (type === 'start' || type === 'end') {
+ style.background = this.color;
+ } else if (type === 'middle') {
+ style.color = this.color;
+ }
+ }
+
return style;
},
@@ -168,7 +177,7 @@ export default createComponent({
genDay(item, index) {
const { type, topInfo, bottomInfo } = item;
- const style = this.getDayStyle(index);
+ const style = this.getDayStyle(type, index);
const onClick = () => {
if (type !== 'disabled') {
@@ -179,7 +188,9 @@ export default createComponent({
if (type === 'selected') {
return (