DatePicker 日期选择器

DatePicker 日期选择器

何时使用

  • 需要选择单个日期或日期范围时。

基础用法

选中:(未选择)
<script setup lang="ts">
import { ref } from "vue";
const date = ref<string | null>(null);
</script>

<template>
  <DatePicker v-model="date" />
</template>

导入

import { DatePicker } from "@reglow/reui";

Props

属性类型默认值说明
modelValuestring | nullnull选中日期(v-model)
placeholderstring跟随语言占位文字
formatstring"YYYY-MM-DD"输出格式(dayjs 格式串)
showTimebooleanfalse是否显示时间选择
disabledbooleanfalse禁用
allowClearbooleantrue显示清除按钮

另有 DatePickerCore(支持 picker="date | week | month | year")与 CalendarPanel 面板组件可按需使用。

国际化

placeholder、面板中的星期、年月格式、时间标签等文案默认跟随全局语言(zh-CN / zh-TW / en-US),传 prop 可覆盖。