当前位置:网站首页>014_ TimePicker time selector
014_ TimePicker time selector
2022-06-24 04:56:00 【Free and bound javajavascript】
1. TimePicker Time selector
1.1. Used to select or enter a date .
1.2. Time selector properties
Parameters | explain | type | Optional value | The default value is |
value / v-model | Binding value | date(TimePicker) / string(TimeSelect) | nothing | nothing |
readonly | Completely read only | boolean | nothing | false |
disabled | Ban | boolean | nothing | false |
editable | Text box to enter | boolean | nothing | true |
clearable | Is the clear button displayed | boolean | nothing | true |
size | Input box size | string | medium / small / mini | nothing |
placeholder | Space occupying content in non range selection | string | nothing | nothing |
start-placeholder | The space occupying content of the start date when selecting the range | string | nothing | nothing |
end-placeholder | The space occupying content of the start date when selecting the range | string | nothing | nothing |
is-range | Select for time range , Only on <el-time-picker> It works | boolean | nothing | false |
arrow-control | Whether to use arrows for time selection , Only on <el-time-picker> It works | boolean | nothing | false |
align | Alignment mode | string | left / center / right | left |
popper-class | TimePicker The class name of the drop-down box | string | nothing | nothing |
picker-options | Refer to the following table for the specific options of the current time and date selector | object | nothing | {} |
range-separator | Separator when selecting a range | string | nothing | '-' |
value-format | Optional , only TimePicker You can use , The format of the bound value . If not specified, the binding value is Date object | string | See date format | nothing |
default-value | Optional , The default time displayed when the selector is on | Date(TimePicker) / string(TimeSelect) | Can be new Date() analysis (TimePicker) / Optional value (TimeSelect) | nothing |
name | Native properties | string | nothing | nothing |
prefix-icon | Custom header icon class name | string | nothing | el-icon-time |
clear-icon | Customize the class name of the empty Icon | string | nothing | el-icon-circle-close |
1.3. Time Select Options
Parameters | explain | type | Optional value | The default value is |
start | Starting time | string | nothing | 09:00 |
end | End time | string | nothing | 18:00 |
step | Time interval between | string | nothing | 00:30 |
minTime | Minimum time , Time periods less than this time will be disabled | string | nothing | 00:00 |
maxTime | Maximum time , Time periods greater than this time will be disabled | string | nothing | nothing |
1.4. Time Picker Options
Parameters | explain | type | Optional value | The default value is |
selectableRange | Optional time period , for example : '18:30:00 - 20:30:00' Or pass in an array ['09:30:00 - 12:00:00', '14:30:00 - 18:30:00'] | string / array | nothing | nothing |
format | Time format (TimePicker) | string | Hours : HH, branch : mm, second :ss, AM/PM | 'HH:mm:ss' |
1.5. Time selector Events
Event name | explain | Parameters |
change | Triggered when the user confirms the selected value | Component binding value |
blur | When input Trigger when out of focus | Component instance |
focus | When input Trigger when you get focus | Component instance |
1.6. Time selector method
Method name | explain |
focus | send input Get focus |
2. Time selector example
2.1. Use the scaffold to create a new one named element-ui-timepicker Front end projects , At the same time to install Element plug-in unit .

2.2. To write App.vue
<template>
<div id="app">
<h1> Fixed time - Provide several fixed time points for users to choose </h1>
<h4> Use el-time-select label , Pass respectively start、end and step Specify an optional start time 、 End time and step size .</h4>
<el-time-select v-model="val1" :picker-options="{ start: '08:30', step: '00:15', end: '18:30' }" placeholder=" Selection time "></el-time-select>
<h1> Any time </h1>
<h4> Use el-time-picker label , adopt selectableRange Limit the optional time range . Provides two ways of interaction : By default, you can select through the mouse wheel , open arrow-control Attribute is selected by the arrow on the interface .</h4>
<el-time-picker v-model="val21" :picker-options="{ selectableRange: '18:30:00 - 20:30:00' }" placeholder=" Any time "></el-time-picker>
<div style="display: inline-block; margin-left: 20px;"></div>
<el-time-picker arrow-control v-model="val22" :picker-options="{ selectableRange: '18:30:00 - 20:30:00' }" placeholder=" Any time "></el-time-picker>
<h1> Fixed time range </h1>
<h4> If you select the start time first , The status of the options will change during the end time .</h4>
<el-time-select placeholder=" Starting time " v-model="startTime" :picker-options="{ start: '08:30', step: '00:15', end: '18:30' }"></el-time-select>
<div style="display: inline-block; margin-left: 20px;"></div>
<el-time-select placeholder=" End time " v-model="endTime" :picker-options="{ start: '08:30', step: '00:15', end: '18:30', minTime: startTime }"></el-time-select>
<h1> Any time range - Any time range can be selected </h1>
<h4> add to is-range Property to select the time range , Also supports arrow-control attribute .</h4>
<el-time-picker is-range v-model="val41" range-separator=" to " start-placeholder=" Starting time " end-placeholder=" End time " placeholder=" Choose a time frame "></el-time-picker>
<div style="display: inline-block; margin-left: 20px;"></div>
<el-time-picker is-range arrow-control v-model="val42" range-separator=" to " start-placeholder=" Starting time " end-placeholder=" End time " placeholder=" Choose a time frame "></el-time-picker>
</div>
</template>
<script>
export default {
data () {
return {
val1: '',
val21: new Date(2016, 9, 10, 18, 40),
val22: new Date(2016, 9, 10, 18, 40),
startTime: '',
endTime: '',
val41: [new Date(2016, 9, 10, 8, 40), new Date(2016, 9, 10, 9, 40)],
val42: [new Date(2016, 9, 10, 8, 40), new Date(2016, 9, 10, 9, 40)]
}
}
}
</script>2.3. Run the project

边栏推荐
- Elfk service setup
- 一文简述:供应链攻击知多少
- Bi-sql - Select
- How to add a domain name to ECS? What are the advantages of ECS?
- apipost接口断言详解
- 黑马程序员机器学习讲义:线性回归api初步使用
- How to select a suitable optical fiber tester
- Facebook内部通告:将重新整合即时通讯功能
- How to build a website for ECS is the price of ECS very expensive
- Physicochemical properties and specificity of Worthington trypsin
猜你喜欢

MySQL - SQL execution process

Analysis on the subjective enthusiasm of post-90s makers' Education

An interface testing software that supports offline document sharing in the Intranet

梯度下降法介绍-黑马程序员机器学习讲义

阿里云新一代云计算体系架构 CIPU 到底是啥?

Idea creates a servlet and accesses the 404 message

Detailed explanation of tcpip protocol

线性回归的损失和优化,机器学习预测房价

SAP mts/ato/mto/eto topic 10: ETO mode q+ empty mode unvalued inventory policy customization

让孩子们学习Steam 教育的应用精髓
随机推荐
Bi-sql distinct
How to restart the ECS? What are the differences between ECS restart and normal computers?
What is Ping? How can the server disable Ping?
Before creating an image, it is recommended to execute the following code to purify the image as an administrator
什么是数据中台
mini-Web框架:装饰器方式的添加路由 | 黑马程序员
Naming of tables in MySQL
What is the data center
How does ECS publish websites? What software tools are needed?
Ext4 file system jam caused by MEM CGroup OOM
Analyzing the superiority of humanoid robot in the post human era
How to control CDN traffic gracefully in cloud development?
Introduction to vulnerability priority technology (VPT)
解析90后创客教育的主观积极性
There are many ways to confirm and modify the remote port number
阿里云混合云首席架构师张晓丹:政企混合云技术架构的演进和发展
Physicochemical properties and specificity of Worthington trypsin
Activity recommendation | cloud native community meetup phase VII Shenzhen station begins to sign up!
一款支持内网脱机分享文档的接口测试软件
How RedHat 8 checks whether the port is connected