W3Cschool
恭喜您成為首批注冊(cè)用戶
獲得88經(jīng)驗(yàn)值獎(jiǎng)勵(lì)
用于選擇或輸入日期
提供幾個(gè)固定的時(shí)間點(diǎn)供用戶選擇
使用 el-time-select 標(biāo)簽,分別通過(guò)start、end和step指定可選的起始時(shí)間、結(jié)束時(shí)間和步長(zhǎng)
<template>
<el-time-select
v-model="value"
start="08:30"
step="00:15"
end="18:30"
placeholder="選擇時(shí)間"
>
</el-time-select>
</template>
<script>
export default {
data() {
return {
value: '',
}
},
}
</script>
若先選擇開(kāi)始時(shí)間,則結(jié)束時(shí)間內(nèi)備選項(xiàng)的狀態(tài)會(huì)隨之改變
<template>
<el-time-select
placeholder="起始時(shí)間"
v-model="startTime"
start="08:30"
step="00:15"
end="18:30"
>
</el-time-select>
<el-time-select
placeholder="結(jié)束時(shí)間"
v-model="endTime"
start="08:30"
step="00:15"
end="18:30"
:minTime="startTime"
>
</el-time-select>
</template>
<script>
export default {
data() {
return {
startTime: '',
endTime: '',
}
},
}
</script>
參數(shù) | 說(shuō)明 | 類型 | 可選值 | 默認(rèn)值 |
---|---|---|---|---|
model-value / v-model | 綁定值 | string | — | — |
disabled | 禁用 | boolean | — | false |
editable | 文本框可輸入 | boolean | — | true |
clearable | 是否顯示清除按鈕 | boolean | — | true |
size | 輸入框尺寸 | string | medium / small / mini | — |
placeholder | 非范圍選擇時(shí)的占位內(nèi)容 | string | — | — |
name | 原生屬性 | string | — | — |
prefix-icon | 自定義頭部圖標(biāo)的類名 | string | — | el-icon-time |
clear-icon | 自定義清空?qǐng)D標(biāo)的類名 | string | — | el-icon-circle-close |
start | 開(kāi)始時(shí)間 | string | — | 09:00 |
end | 結(jié)束時(shí)間 | string | — | 18:00 |
step | 間隔時(shí)間 | string | — | 00:30 |
minTime | 最小時(shí)間,小于該時(shí)間的時(shí)間段將被禁用 | string | — | 00:00 |
maxTime | 最大時(shí)間,大于該時(shí)間的時(shí)間段將被禁用 | string | — | — |
事件名 | 說(shuō)明 | 參數(shù) |
---|---|---|
change | 用戶確認(rèn)選定的值時(shí)觸發(fā) | 組件綁定值 |
blur | 當(dāng) input 失去焦點(diǎn)時(shí)觸發(fā) | 組件實(shí)例 |
focus | 當(dāng) input 獲得焦點(diǎn)時(shí)觸發(fā) | 組件實(shí)例 |
方法名 | 說(shuō)明 | 參數(shù) |
---|---|---|
focus | 使 input 獲取焦點(diǎn) | — |
blur | 使 input 失去焦點(diǎn) | — |
Copyright©2021 w3cschool編程獅|閩ICP備15016281號(hào)-3|閩公網(wǎng)安備35020302033924號(hào)
違法和不良信息舉報(bào)電話:173-0602-2364|舉報(bào)郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號(hào)
聯(lián)系方式:
更多建議: