Skip to content
目录

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

NameDescriptionTypeDefault
model-value / v-modelbinding value (YYYY-MM-DD)string''
disableddisabledbooleanfalse
clearableclearablebooleantrue
placeholderplaceholderstring'请选择日期'
widthinput widthstring'240px'
panel-widthpanel widthstring'320px'
first-day-of-weekfirst day of week (0-6)number0
disabled-datedisable date (return true means disabled)(date: Date) => boolean-
shortcutsshortcuts{ text: string; value: string | Date | (() => string | Date) }[][]

Events

NameDescriptionParams
update:modelValuev-model update(value: string)
changevalue change(value: string)
clearemitted when cleared-
visible-changedropdown visibility change(visible: boolean)
panel-changepanel month change({ year: number; month: number })

Contributors

Mr.Fan