feat(Calendar): add month mark

This commit is contained in:
陈嘉涵 2019-12-24 14:49:56 +08:00 committed by neverland
parent c53c4a78bb
commit 9f1e3b0fde
2 changed files with 13 additions and 0 deletions

View File

@ -90,6 +90,7 @@ export default createComponent({
<div class={bem('month')} ref="month" refInFor>
{showTitle && <div class={bem('month-title')}>{month.title}</div>}
<div class={bem('days')}>
<div class={bem('month-mark')}>{month.date.getMonth() + 1}</div>
{month.days.map(item => (
<div class={bem('day')}>{item.day}</div>
))}

View File

@ -49,10 +49,22 @@
}
&__days {
position: relative;
display: flex;
flex-wrap: wrap;
}
&__month-mark {
position: absolute;
top: 50%;
left: 50%;
z-index: -1;
color: @gray-2;
font-size: 160px;
transform: translate(-50%, -50%);
pointer-events: none;
}
&__day {
display: flex;
align-items: center;