【发布时间】:2019-11-24 09:32:31
【问题描述】:
我正在尝试使用 react-bootstrap-datetimerangepicker,在在线演示 (http://luqin.xyz/react-bootstrap-datetimerangepicker/#/) 中,菜单顶部似乎有一个文本输入字段,单击时会打开。
在我的实现中,没有出现那个文本输入框。
我想知道我是否错误地导入了 .css?但是我复制了示例的源代码,我仍然得到了这个结果。
import 'bootstrap/dist/css/bootstrap.css';
import DatetimeRangePicker from 'react-bootstrap-datetimerangepicker';
import 'bootstrap-daterangepicker/daterangepicker.css';
class Sidebar extends Component{
constructor(props) {
super(props);
this.state = {
fromDate: new Date(),
toDate: new Date(),
};
}
handleApply(event, picker) {
this.setState({
fromDate: picker.startDate.format('YYYY-MM-DD HH:mm:ss'),
toDate: picker.endDate.format('YYYY-MM-DD HH:mm:ss'),
});
}
render(){
return(
<DatetimeRangePicker
timePicker={true}
timePicker24Hour={true}
timePickerSeconds={true}
showDropdowns={true}
onApply={this.handleApply}
opens={"center"}
startDate={this.state.fromDate}
endDate={this.state.toDate}>
<Button >
Date and Time Range
</Button>}
</DatetimeRangePicker>
)
}
}
【问题讨论】:
-
我很肯定这与我使用的 react daterangepicker 版本有关,我正在切换版本,但没有任何变化
标签: reactjs bootstrap-daterangepicker