切换主题
YDateRangePicker
适用范围:Legacy Admin Kit / Schema 与旧
admin-vue。新admin-nuxtui的开发入口见管理端 Nuxt UI 指南。
定位 / Owner
YDateRangePicker 组合两个 YDatePicker,公共值为 [start, end] DateOnly tuple。父级是 authoritative owner;组件只保存 in-flight acknowledgement。
基础用法
vue
<YDateRangePicker v-model="range" aria-label="统计日期" />Public API
| API | 说明 |
|---|---|
modelValue | readonly [string, string] |
update:modelValue | 发出新的 [start, end] |
id | 起始日期 control id;结束日期自动追加 -end |
disabled | 同时禁用起止日期 |
compact | 紧凑密度 |
ariaLabel | 自动派生“开始日期 / 结束日期”可访问名称 |
ariaDescribedby / ariaInvalid | 同步传递给起止日期 control |
关键交互
组件覆盖 delayed write-back、stale echo、latest echo、authoritative reset 与 disabled;不要在 feature 再加一份 range draft。
Live Workbench
Admin Vue 稳定路径:
/frontend-module-demo/component-workbench/date-range-picker
该路径只标识 live scenario,不固化部署 Host;官方文档站与 Admin Vue 可以独立部署。
Verification / Source
packages/yoyo-admin/admin-kit/src/ui/components/date-picker/YDateRangePicker.vuetests/unit/ui/date-range-picker-controlled-model.spec.ts- Live Component Workbench