mirror of
https://github.com/ant-design/ant-design.git
synced 2025-08-06 07:56:28 +08:00
Add default width for showTime DatePicker
This commit is contained in:
parent
6d122fa5b1
commit
20211d448c
@ -14,6 +14,6 @@ function onChange(value) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
ReactDOM.render(
|
ReactDOM.render(
|
||||||
<DatePicker showTime format="yyyy-MM-dd HH:mm:ss" placeholder="请选择时间" onChange={onChange} style={{ width: 160 }} />
|
<DatePicker showTime format="yyyy-MM-dd HH:mm:ss" placeholder="请选择时间" onChange={onChange} />
|
||||||
, mountNode);
|
, mountNode);
|
||||||
````
|
````
|
||||||
|
@ -114,8 +114,15 @@ function createPicker(TheCalendar, defaultFormat) {
|
|||||||
if (this.state.open) {
|
if (this.state.open) {
|
||||||
pickerClass += ' ant-calendar-picker-open';
|
pickerClass += ' ant-calendar-picker-open';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// default width for showTime
|
||||||
|
const pickerStyle = {};
|
||||||
|
if (this.props.showTime) {
|
||||||
|
pickerStyle.width = 180;
|
||||||
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<span className={pickerClass} style={this.props.style}>
|
<span className={pickerClass} style={{ ...pickerStyle, ...this.props.style }}>
|
||||||
<DatePicker
|
<DatePicker
|
||||||
transitionName={this.props.transitionName}
|
transitionName={this.props.transitionName}
|
||||||
disabled={this.props.disabled}
|
disabled={this.props.disabled}
|
||||||
|
Loading…
Reference in New Issue
Block a user