feat: 完善时间类的事件和动作

This commit is contained in:
sqzhou 2022-02-09 19:02:29 +08:00
parent da8ba7cfe3
commit 9c336c6316
3 changed files with 6 additions and 15 deletions

View File

@ -415,12 +415,9 @@ export default class DateControl extends React.PureComponent<
// 派发有event的事件
@autobind
dispatchEvent(e: React.SyntheticEvent<HTMLElement> | string) {
dispatchEvent(e: React.SyntheticEvent<HTMLElement>) {
const {dispatchEvent, data} = this.props;
const dispatcher = dispatchEvent(e, data);
if (dispatcher?.prevented) {
return;
}
dispatchEvent(e, data);
}
// 动作

View File

@ -165,12 +165,9 @@ export default class DateRangeControl extends React.Component<DateRangeProps> {
// 派发有event的事件
@autobind
dispatchEvent(e: React.SyntheticEvent<HTMLElement> | string) {
dispatchEvent(e: React.SyntheticEvent<HTMLElement>) {
const {dispatchEvent, data} = this.props;
const dispatcher = dispatchEvent(e, data);
if (dispatcher?.prevented) {
return;
}
dispatchEvent(e, data);
}
// 动作

View File

@ -162,12 +162,9 @@ export default class MonthRangeControl extends React.Component<MonthRangeProps>
// 派发有event的事件
@autobind
dispatchEvent(e: React.SyntheticEvent<HTMLElement> | string) {
dispatchEvent(e: React.SyntheticEvent<HTMLElement>) {
const {dispatchEvent, data} = this.props;
const dispatcher = dispatchEvent(e, data);
if (dispatcher?.prevented) {
return;
}
dispatchEvent(e, data);
}
// 动作