react-week-time-range-picker
v1.11.4
Published
```js npm install react-week-time-range-picker --save-dev
Downloads
49
Readme
react-week-time-range-picker
用法 | usage
npm install react-week-time-range-picker --save-dev
// jsx/tsx
import ReactWeekTimeRangePicker from 'react-week-time-range-picker'
const Test = () => {
// 获取选中的值
const handleSelectTimeRange = (selectedData) => {
console.log(selectedData)
}
}
<react-week-time-range-picker hasHalfHour={true} selectedData={[]} selectTimeRange={handleSelectTimeRange} />
API
interface ReactWeekTimeRangePickerProps {
hasHalfHour?: boolean; // true | false (默认带半小时 | default with half-hour)
selectedData?: SelectedDataProps[];
selectTimeRange?: (checked: SelectedDataProps[]) => void // 接收选中的时间 | receive selected time
}
// selectedData 数据结构/Data Structures
[
{
iden: '3',
mergeTimes: [['02:30', '03:00']],
times: ['02:30'],
week: '星期四'
}
]
图示
见vue-week-time-range-picker
兼容性 | compatible
| | chrome | | ---- | ---- | | version | 77 |
注意
- 测试发现,edge浏览器中会受margin和padding影响,从而导致框选有偏差,建议不要对其父元素使用margin和padding。
- 测试发现,直接引入时,左侧偏移位置有出入,目前修复,待反馈。
- react hooks写的组件发包大坑啊,看这个issue 17014还有这个解决方法:solution