ant-design/components/time-picker/demo/disable-options.md

28 lines
509 B
Markdown
Raw Normal View History

2015-12-16 17:29:28 +08:00
# 禁止选项
- 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'));
````