Skip to content

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
modemonth / yearstringmonth
show-week-number显示 ISO 周号列boolean
value选中值(ISO)string

事件

事件说明
oas-change选中变化,detail: { value }

键盘:/// 在网格内移动,Enter 选中。