Calendar 日历
日历组件,月/年两种模式,支持选中、禁用日期、周号与键盘网格导航;日期描述走 Intl.DateTimeFormat(locale 感知)。
基础用法
月视图(mode=month)
点击日期选中并派发 oas-change;标题可点开月选择面板快速跳月。
年视图
年视图(mode=year)
年模式选中月份派发 yyyy-MM。
禁用范围
min / max 限制
禁用回调
disabled-date(禁用周末)
disabledDate 走 property 传入回调(JSON 无法表达函数)。
周号
显示周号(show-week-number)
事件
oas-change 事件
API
属性
| 属性 | 说明 | 类型 | 默认值 |
|---|---|---|---|
disabledDate | 禁用回调(property) | ((d: Date) => boolean) | null | — |
max | 可选范围(ISO 日期) | string | — |
min | 可选范围(ISO 日期) | string | — |
mode | month / year | string | month |
show-week-number | 显示 ISO 周号列 | boolean | — |
value | 选中值(ISO) | string | — |
事件
| 事件 | 说明 |
|---|---|
oas-change | 选中变化,detail: { value } |
键盘:↑/↓/←/→ 在网格内移动,Enter 选中。