Date Picker
A single-date picker. It opens a date panel from an input and writes back YYYY-MM-DD after selection.
Basic
html
<template>
<dk-date-picker v-model="value" />
</template>
<script setup>
import { ref } from 'vue'
const value = ref('2026-01-29')
</script>展开
Disabled
html
<template>
<dk-date-picker v-model="value" disabled />
</template>展开
Clearable
html
<template>
<dk-date-picker v-model="value" clearable />
</template>展开
Props
| Name | Description | Type | Default |
|---|---|---|---|
| model-value / v-model | binding value (YYYY-MM-DD) | string | '' |
| disabled | disabled | boolean | false |
| clearable | clearable | boolean | true |
| placeholder | placeholder | string | '请选择日期' |
| width | input width | string | '240px' |
| panel-width | panel width | string | '320px' |
| first-day-of-week | first day of week (0-6) | number | 0 |
| disabled-date | disable date (return true means disabled) | (date: Date) => boolean | - |
| shortcuts | shortcuts | { text: string; value: string | Date | (() => string | Date) }[] | [] |
Events
| Name | Description | Params |
|---|---|---|
| update:modelValue | v-model update | (value: string) |
| change | value change | (value: string) |
| clear | emitted when cleared | - |
| visible-change | dropdown visibility change | (visible: boolean) |
| panel-change | panel month change | ({ year: number; month: number }) |