跳转正文

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说明
modelValuereadonly [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.vue
  • tests/unit/ui/date-range-picker-controlled-model.spec.ts
  • Live Component Workbench

YoyoBoot · 从真实项目走向可复用能力