mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-02 15:59:38 +08:00
28 lines
526 B
Markdown
28 lines
526 B
Markdown
|
# 隐藏选项
|
||
|
|
||
|
- 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'));
|
||
|
````
|