czcaiwj/calendar

days-color数组项构成 让日历显示下个月 month属性无法生效

hzp-ui opened this issue · 3 comments

dayStyle1: [{
month: 'next',
day: new Date().getDate(),
color: 'white',
background: 'red'
},
{
month: 'next',
day: new Date().getDate(),
color: 'white',
background: 'red'
}
]

@hzp-ui 你是不是搞开发的啊

month属性只是用来显示非当前月的月份days-color用的,不同月份days-color应该是单独定义为一个json对象
像这样:
days: { "3": [{ "month": "current", "day": 8, "color": "white", "background": "red", "title": "妇女节", "schedulecolor": "#ff0000" }], "4": [{ "month": "current", "day": 1, "color": "white", "background": "red", "title": "愚人节", "schedulecolor": "#ff0000" }] }
切换月份时将对应json对象赋值给dayStyle
我是这样理解和这样使用的

skytt commented

month属性只是用来显示非当前月的月份days-color用的,不同月份days-color应该是单独定义为一个json对象
像这样:
days: { "3": [{ "month": "current", "day": 8, "color": "white", "background": "red", "title": "妇女节", "schedulecolor": "#ff0000" }], "4": [{ "month": "current", "day": 1, "color": "white", "background": "red", "title": "愚人节", "schedulecolor": "#ff0000" }] }
切换月份时将对应json对象赋值给dayStyle
我是这样理解和这样使用的

month属性只是用来显示非当前月的月份days-color用的,不同月份days-color应该是单独定义为一个json对象
像这样:
days: { "3": [{ "month": "current", "day": 8, "color": "white", "background": "red", "title": "妇女节", "schedulecolor": "#ff0000" }], "4": [{ "month": "current", "day": 1, "color": "white", "background": "red", "title": "愚人节", "schedulecolor": "#ff0000" }] }
切换月份时将对应json对象赋值给dayStyle
我是这样理解和这样使用的

这样使用的话,切换月份的时候我会出现渲染延迟的问题,就是会有上个月的日期标记闪过