ant-design/components/time-picker/demo/addon.md
damon.chen e7f5030f2b
fix: change Ok to OK (#32259)
* 修复AutoComplete组件allowClear属性的说明有歧义的问题

* fix: change Ok to OK

* update jest snapshot

Co-authored-by: chj_damon <chjdamon@gmail.com>
2021-09-23 22:13:05 +08:00

802 B

order title
6
zh-CN en-US
附加内容 Addon

zh-CN

在 TimePicker 选择框底部显示自定义的内容。

en-US

Render addon contents to time picker panel's bottom.

import { TimePicker, Button } from 'antd';

class TimePickerAddonDemo extends React.Component {
  state = { open: false };

  handleOpenChange = open => {
    this.setState({ open });
  };

  handleClose = () => this.setState({ open: false });

  render() {
    return (
      <TimePicker
        open={this.state.open}
        onOpenChange={this.handleOpenChange}
        renderExtraFooter={() => (
          <Button size="small" type="primary" onClick={this.handleClose}>
            OK
          </Button>
        )}
      />
    );
  }
}

ReactDOM.render(<TimePickerAddonDemo />, mountNode);