vue element plus TimePicker 时间选择器

简介: vue element plus TimePicker 时间选择器

用于选择或输入日期

TIP

在 SSR 场景下,您需要将组件包裹在 <client-only></client-only> 之中 (如: Nuxt) 和 SSG (e.g: VitePress).

任意时间点#

可以选择任意时间

提供了两种交互方式:默认情况下通过鼠标滚轮进行选择,打开arrow-control属性则通过界面上的箭头进行选择。

限制时间选择范围#

您也可以限制时间选择范围。

通过 disabledHoursdisabledMinutesdisabledSeconds 限制可选时间范围。,

任意时间范围#

可选择任意的时间范围

添加is-range属性即可选择时间范围。 同样支持 arrow-control 属性。

To

To

API#

Attributes#

属性名 说明 类型 默认
model-value / v-model 绑定值,如果它是数组,长度应该是 2 number / string / object ''
readonly 完全只读 boolean false
disabled 禁用 boolean false
editable 文本框可输入 boolean true
clearable 是否显示清除按钮 boolean true
size 输入框尺寸 enum
placeholder 非范围选择时的占位内容 string ''
start-placeholder 范围选择时开始日期的占位内容 string
end-placeholder 范围选择时结束日期的占位内容 string
is-range 是否为时间范围选择 boolean false
arrow-control 是否使用箭头进行时间选择 boolean false
popper-class TimePicker 下拉框的类名 string ''
range-separator 选择范围时的分隔符 string '-'
format 显示在输入框中的格式 string see date formats
default-value 可选,选择器打开时默认显示的时间 Date / object
id 等价于原生 input id 属性 string / object
name 等价于原生 input name 属性 string ''
label a11y 等价于原生 input aria-label 属性 string
prefix-icon 自定义前缀图标 string / Component Clock
clear-icon 自定义清除图标 string / Component CircleClose
disabled-hours 禁止选择部分小时选项 Function
disabled-minutes 禁止选择部分分钟选项 Function
disabled-seconds 禁止选择部分秒选项 Function
teleported 是否将 popover 的下拉列表镜像至 body 元素 boolean true
tabindex 输入框的 tabindex string / number 0

事件#

事件名 说明 类型
change 用户确认选定的值时触发 Function
blur 在组件 Input 失去焦点时触发 Function
focus 在组件 Input 获得焦点时触发 Function
visible-change 当 TimePicker 的下拉列表出现/消失时触发 Function

暴露#

名称 说明 Type
focus 使 input 获取焦点 Function
blur 使 input 失去焦点 Function
handleOpen 2.2.16 打开时间选择器弹窗 Function
handleClose 2.2.16 关闭时间选择器弹窗 Function

源代码#

组件文档

相关文章
|
4天前
|
JavaScript 前端开发 安全
Vue响应式设计
【5月更文挑战第30天】Vue响应式设计
25 1
|
4天前
|
JavaScript 程序员 网络架构
vue路由从入门到进阶 --- 声明式导航详细教程
vue路由从入门到进阶 --- 声明式导航详细教程
vue路由从入门到进阶 --- 声明式导航详细教程
|
4天前
|
资源调度 JavaScript UED
vue路由的基础知识总结,vueRouter插件的安装与使用
vue路由的基础知识总结,vueRouter插件的安装与使用
|
4天前
|
JavaScript
|
4天前
|
编解码 JavaScript API
Vue在移动端的表现如何?
【5月更文挑战第30天】Vue在移动端的表现如何?
11 2
|
4天前
|
JavaScript 前端开发 API
Vue与其他框架的对比优势
【5月更文挑战第30天】Vue与其他框架的对比优势
11 1
|
5天前
|
JavaScript
Vue常用知识点总结
Vue常用知识点总结
12 0
|
5天前
|
JavaScript Java 测试技术
基于vue和微信小程序的校园自助打印系统+springboot+vue.js附带文章和源代码设计说明文档ppt
基于vue和微信小程序的校园自助打印系统+springboot+vue.js附带文章和源代码设计说明文档ppt
25 7
|
5天前
|
JSON JavaScript 前端开发
|
6天前
|
JavaScript 前端开发 Java
开发语言漫谈-Vue
Vue严格说来不是一门语言