Skip to content

DatePicker 日期选择器

基础用法

日期时间选择

无边框

禁用

三种大小

额外的页脚

后缀图标

DatePicker API

DatePicker Attributes

NameDescriptionTypeDefaultVersion
value(v-model)绑定值dayjs
open(v-model)面板是否打开booleanfalse
mode设置选择器类型date | week | month | quarter | yearfalse
placeholder没有值的时候显示的内容string | [string, string]请选择时间
disabled禁用booleanfalse
disabledDate不可选择的日期(currentDate: dayjs) => boolean
size输入框尺寸large | default | small
readonly设置输入框为只读booleanfalse
allowClear是否可以清空选项booleanfalse
bordered无边框样式booleanfalse
showNow面板是否显示“此刻”按钮booleantrue
format展示的日期格式stringYYYY-MM-DD
valueFormat绑定值的格式string 具体格式YYYY-MM-DD
showTime增加时间选择功能Object | booleanTimePicker Options
showToday是否展示“今天”按钮booleantrue

DatePicker Events

NameDescriptionType
change日期发生变化的回调(time: dayjs | string) => void
openChange面板打开/关闭时的回调(open: boolean) => void

DatePicker Slots

NameDescription
renderExtraFooter选择框底部显示自定义的内容
suffixIcon自定义的选择框后缀图标

贡献者

lazy

变更记录

075de - fix: 修复date-picker报错 on 12/9/2024
0efb5 - fix: 修正日期时间选择器交互效果 on 1/10/2024
ae3d4 - fix: 修复年份显示不正确 on 1/4/2024
5cd34 - feat: date-picker on 1/2/2024

Released under the MIT License.