MG12
9 years ago
10 changed files with 86 additions and 36 deletions
@ -0,0 +1,27 @@ |
|||
# 禁止选项 |
|||
|
|||
- order: 5 |
|||
|
|||
禁止部分选项。 |
|||
|
|||
--- |
|||
|
|||
````jsx |
|||
import { TimePicker } from 'antd'; |
|||
|
|||
function disabledHours() { |
|||
return [0, 4, 8, 12, 16, 20]; |
|||
} |
|||
|
|||
function disabledMinutes(h) { |
|||
return [h % 60]; |
|||
} |
|||
|
|||
function disabledSeconds(h, m) { |
|||
return [h + m % 60]; |
|||
} |
|||
|
|||
ReactDOM.render( |
|||
<TimePicker defaultValue="12:08:23" disabledHours={disabledHours} disabledMinutes={disabledMinutes} disabledSeconds={disabledSeconds} /> |
|||
, document.getElementById('components-time-picker-demo-disable-options')); |
|||
```` |
@ -0,0 +1,27 @@ |
|||
# 隐藏选项 |
|||
|
|||
- order: 6 |
|||
|
|||
禁止部分选项。 |
|||
|
|||
--- |
|||
|
|||
````jsx |
|||
import { TimePicker } from 'antd'; |
|||
|
|||
function disabledHours() { |
|||
return [0, 4, 8, 12, 16, 20]; |
|||
} |
|||
|
|||
function disabledMinutes(h) { |
|||
return [h % 60]; |
|||
} |
|||
|
|||
function disabledSeconds(h, m) { |
|||
return [h + m % 60]; |
|||
} |
|||
|
|||
ReactDOM.render( |
|||
<TimePicker defaultValue="12:08:23" disabledHours={disabledHours} disabledMinutes={disabledMinutes} disabledSeconds={disabledSeconds} hideDisabledOptions /> |
|||
, document.getElementById('components-time-picker-demo-hide-options')); |
|||
```` |
@ -1,15 +0,0 @@ |
|||
# 特定选项 |
|||
|
|||
- order: 3 |
|||
|
|||
分钟只提供特定的选择,同时可以通过 `hourOptions` 和 `secondOptions` 对小时和秒进行特殊的限定。 |
|||
|
|||
--- |
|||
|
|||
````jsx |
|||
import { TimePicker } from 'antd'; |
|||
|
|||
ReactDOM.render( |
|||
<TimePicker defaultValue="12:30:23" format="HH:mm" minuteOptions={[0, 30]} /> |
|||
, document.getElementById('components-time-picker-demo-special-minutes')); |
|||
```` |
Loading…
Reference in new issue