我在我的一个项目中使用了来自 Airbnb 的 react-dates 插件。我正在使用 daterangepicker 默认日历props,例如http://airbnb.io/react-dates/?path=/story/drp-calendar-props--default。但这在从标签到移动设备的较小设备中没有响应。我想在选项卡和移动视图中进行一些更改,就像它显示为垂直日历一样http://airbnb.io/react-dates/?path=/story/drp-calendar-props--vertical。我想使用文档中给定的props来实现这一点,并使用媒体查询在 CSS 中进行更改。到目前为止,这是我的实现:
<DateRangePicker
startDate={startDate}
startDateId="startDate"
endDate={endDate}
endDateId="startDate"
customInputIcon={customInputIcon}
onDatesChange={this.onDatesChange}
focusedInput={focusedInput}
onFocusChange={this.onFocusChange}
hideKeyboardShortcutsPanel={hideKeyboardShortcutsPanel}
appendToBody={true}
navPrev={navPrev}
navNext={navNext}
isOutsideRange={this.isOutsideRange}
/>
但不确定在这种响应性的情况下如何实现。