Skip to content

Commit 02c95d9

Browse files
author
coffeebi
committed
fix: add array type to event cb props's declaration (vueComponent#5410 vueComponent#5414)
related issue vueComponent#5127 vueComponent#5138
1 parent 5b3ade8 commit 02c95d9

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

55 files changed

+185
-175
lines changed

components/_util/transButton.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ const TransButton = defineComponent({
2020
inheritAttrs: false,
2121
props: {
2222
noStyle: { type: Boolean, default: undefined },
23-
onClick: Function,
23+
onClick: [Function, Array],
2424
disabled: { type: Boolean, default: undefined },
2525
autofocus: { type: Boolean, default: undefined },
2626
},

components/affix/index.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,8 @@ export const affixProps = () => ({
5454
},
5555
prefixCls: String,
5656
/** 固定状态改变时触发的回调函数 */
57-
onChange: Function as PropType<AffixEmits['change']>,
58-
onTestUpdatePosition: Function as PropType<AffixEmits['testUpdatePosition']>,
57+
onChange: [Function, Array] as PropType<AffixEmits['change']>,
58+
onTestUpdatePosition: [Function, Array] as PropType<AffixEmits['testUpdatePosition']>,
5959
});
6060

6161
export type AffixProps = Partial<ExtractPropTypes<ReturnType<typeof affixProps>>>;

components/alert/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export const alertProps = () => ({
5757
banner: { type: Boolean, default: undefined },
5858
icon: PropTypes.any,
5959
closeIcon: PropTypes.any,
60-
onClose: Function as PropType<NodeMouseEventHandler>,
60+
onClose: [Function, Array] as PropType<NodeMouseEventHandler>,
6161
});
6262

6363
export type AlertProps = Partial<ExtractPropTypes<ReturnType<typeof alertProps>>>;

components/anchor/Anchor.tsx

+4-2
Original file line numberDiff line numberDiff line change
@@ -59,8 +59,10 @@ export const anchorProps = () => ({
5959
wrapperStyle: { type: Object as PropType<CSSProperties>, default: undefined as CSSProperties },
6060
getCurrentAnchor: Function as PropType<() => string>,
6161
targetOffset: Number,
62-
onChange: Function as PropType<(currentActiveLink: string) => void>,
63-
onClick: Function as PropType<(e: MouseEvent, link: { title: any; href: string }) => void>,
62+
onChange: [Function, Array] as PropType<(currentActiveLink: string) => void>,
63+
onClick: [Function, Array] as PropType<
64+
(e: MouseEvent, link: { title: any; href: string }) => void
65+
>,
6466
});
6567

6668
export type AnchorProps = Partial<ExtractPropTypes<ReturnType<typeof anchorProps>>>;

components/back-top/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ export const backTopProps = () => ({
2525
duration: { type: Number, default: 450 },
2626
target: Function as PropType<() => HTMLElement | Window | Document>,
2727
prefixCls: String,
28-
onClick: Function as PropType<MouseEventHandler>,
28+
onClick: [Function, Array] as PropType<MouseEventHandler>,
2929
// visible: { type: Boolean, default: undefined }, // Only for test. Don't use it.
3030
});
3131

components/breadcrumb/BreadcrumbItem.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ export const breadcrumbItemProps = () => ({
1212
href: String,
1313
separator: PropTypes.any,
1414
overlay: PropTypes.any,
15-
onClick: Function as PropType<MouseEventHandler>,
15+
onClick: [Function, Array] as PropType<MouseEventHandler>,
1616
});
1717

1818
export type BreadcrumbItemProps = Partial<ExtractPropTypes<ReturnType<typeof breadcrumbItemProps>>>;

components/cascader/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ export function cascaderProps<DataNodeType extends CascaderOptionType = Cascader
100100
placement: { type: String as PropType<SelectCommonPlacement> },
101101
suffixIcon: PropTypes.any,
102102
options: Array as PropType<DataNodeType[]>,
103-
'onUpdate:value': Function as PropType<(value: ValueType) => void>,
103+
'onUpdate:value': [Function, Array] as PropType<(value: ValueType) => void>,
104104
};
105105
}
106106

components/checkbox/interface.ts

+6-4
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,9 @@ export const checkboxGroupProps = () => {
4141
...abstractCheckboxGroupProps(),
4242
defaultValue: { type: Array as PropType<Array<CheckboxValueType>> },
4343
value: { type: Array as PropType<Array<CheckboxValueType>> },
44-
onChange: { type: Function as PropType<(checkedValue: Array<CheckboxValueType>) => void> },
44+
onChange: {
45+
type: [Function, Array] as PropType<(checkedValue: Array<CheckboxValueType>) => void>,
46+
},
4547
'onUpdate:value': {
4648
type: Function as PropType<(checkedValue: Array<CheckboxValueType>) => void>,
4749
},
@@ -63,9 +65,9 @@ export const abstractCheckboxProps = () => {
6365
indeterminate: { type: Boolean, default: undefined },
6466
type: { type: String, default: 'checkbox' },
6567
autofocus: { type: Boolean, default: undefined },
66-
onChange: Function as PropType<(e: CheckboxChangeEvent) => void>,
67-
'onUpdate:checked': Function as PropType<(checked: boolean) => void>,
68-
onClick: Function as PropType<MouseEventHandler>,
68+
onChange: [Function, Array] as PropType<(e: CheckboxChangeEvent) => void>,
69+
'onUpdate:checked': [Function, Array] as PropType<(checked: boolean) => void>,
70+
onClick: [Function, Array] as PropType<MouseEventHandler>,
6971
skipGroup: { type: Boolean, default: false },
7072
};
7173
};

components/collapse/commonProps.ts

+3-3
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ const collapseProps = () => ({
3030
expandIconPosition: PropTypes.oneOf(tuple('left', 'right')),
3131
collapsible: { type: String as PropType<CollapsibleType> },
3232
ghost: { type: Boolean, default: undefined },
33-
onChange: Function as PropType<(key: Key | Key[]) => void>,
34-
'onUpdate:activeKey': Function as PropType<(key: Key | Key[]) => void>,
33+
onChange: [Function, Array] as PropType<(key: Key | Key[]) => void>,
34+
'onUpdate:activeKey': [Function, Array] as PropType<(key: Key | Key[]) => void>,
3535
});
3636

3737
const collapsePanelProps = () => ({
@@ -51,7 +51,7 @@ const collapsePanelProps = () => ({
5151
panelKey: PropTypes.oneOfType([PropTypes.string, PropTypes.number]),
5252
collapsible: { type: String as PropType<CollapsibleType> },
5353
role: String,
54-
onItemClick: { type: Function as PropType<(panelKey: Key) => void> },
54+
onItemClick: { type: [Function, Array] as PropType<(panelKey: Key) => void> },
5555
});
5656

5757
export { collapseProps, collapsePanelProps };

components/date-picker/generatePicker/props.ts

+14-12
Original file line numberDiff line numberDiff line change
@@ -49,18 +49,20 @@ function commonProps<DateType = any>() {
4949
onChange: {
5050
type: Function as PropType<(value: DateType | string | null, dateString: string) => void>,
5151
},
52-
'onUpdate:value': { type: Function as PropType<(value: DateType | string | null) => void> },
53-
onOk: { type: Function as PropType<(value: DateType | string | null) => void> },
54-
onOpenChange: { type: Function as PropType<(open: boolean) => void> },
55-
'onUpdate:open': { type: Function as PropType<(open: boolean) => void> },
56-
onFocus: { type: Function as PropType<FocusEventHandler> },
57-
onBlur: { type: Function as PropType<FocusEventHandler> },
58-
onMousedown: { type: Function as PropType<MouseEventHandler> },
59-
onMouseup: { type: Function as PropType<MouseEventHandler> },
60-
onMouseenter: { type: Function as PropType<MouseEventHandler> },
61-
onMouseleave: { type: Function as PropType<MouseEventHandler> },
62-
onClick: { type: Function as PropType<MouseEventHandler> },
63-
onContextmenu: { type: Function as PropType<MouseEventHandler> },
52+
'onUpdate:value': {
53+
type: [Function, Array] as PropType<(value: DateType | string | null) => void>,
54+
},
55+
onOk: { type: [Function, Array] as PropType<(value: DateType | string | null) => void> },
56+
onOpenChange: { type: [Function, Array] as PropType<(open: boolean) => void> },
57+
'onUpdate:open': { type: [Function, Array] as PropType<(open: boolean) => void> },
58+
onFocus: { type: [Function, Array] as PropType<FocusEventHandler> },
59+
onBlur: { type: [Function, Array] as PropType<FocusEventHandler> },
60+
onMousedown: { type: [Function, Array] as PropType<MouseEventHandler> },
61+
onMouseup: { type: [Function, Array] as PropType<MouseEventHandler> },
62+
onMouseenter: { type: [Function, Array] as PropType<MouseEventHandler> },
63+
onMouseleave: { type: [Function, Array] as PropType<MouseEventHandler> },
64+
onClick: { type: [Function, Array] as PropType<MouseEventHandler> },
65+
onContextmenu: { type: [Function, Array] as PropType<MouseEventHandler> },
6466
onKeydown: {
6567
type: Function as PropType<(event: KeyboardEvent, preventDefault: () => void) => void>,
6668
},

components/drawer/index.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -82,9 +82,9 @@ export const drawerProps = () => ({
8282
handle: PropTypes.any,
8383
/** @deprecated Use `@afterVisibleChange` instead */
8484
afterVisibleChange: Function as PropType<(visible: boolean) => void>,
85-
onAfterVisibleChange: Function as PropType<(visible: boolean) => void>,
86-
'onUpdate:visible': Function as PropType<(visible: boolean) => void>,
87-
onClose: Function as PropType<MouseEventHandler | KeyboardEventHandler>,
85+
onAfterVisibleChange: [Function, Array] as PropType<(visible: boolean) => void>,
86+
'onUpdate:visible': [Function, Array] as PropType<(visible: boolean) => void>,
87+
onClose: [Function, Array] as PropType<MouseEventHandler | KeyboardEventHandler>,
8888
});
8989

9090
export type DrawerProps = Partial<ExtractPropTypes<ReturnType<typeof drawerProps>>>;

components/form/Form.tsx

+6-6
Original file line numberDiff line numberDiff line change
@@ -58,15 +58,15 @@ export const formProps = () => ({
5858
validateOnRuleChange: { type: Boolean, default: undefined },
5959
// 提交失败自动滚动到第一个错误字段
6060
scrollToFirstError: { type: [Boolean, Object] as PropType<boolean | Options> },
61-
onSubmit: Function as PropType<(e: Event) => void>,
61+
onSubmit: [Function, Array] as PropType<(e: Event) => void>,
6262
name: String,
6363
validateTrigger: { type: [String, Array] as PropType<string | string[]> },
6464
size: { type: String as PropType<SizeType> },
65-
onValuesChange: { type: Function as PropType<Callbacks['onValuesChange']> },
66-
onFieldsChange: { type: Function as PropType<Callbacks['onFieldsChange']> },
67-
onFinish: { type: Function as PropType<Callbacks['onFinish']> },
68-
onFinishFailed: { type: Function as PropType<Callbacks['onFinishFailed']> },
69-
onValidate: { type: Function as PropType<Callbacks['onValidate']> },
65+
onValuesChange: { type: [Function, Array] as PropType<Callbacks['onValuesChange']> },
66+
onFieldsChange: { type: [Function, Array] as PropType<Callbacks['onFieldsChange']> },
67+
onFinish: { type: [Function, Array] as PropType<Callbacks['onFinish']> },
68+
onFinishFailed: { type: [Function, Array] as PropType<Callbacks['onFinishFailed']> },
69+
onValidate: { type: [Function, Array] as PropType<Callbacks['onValidate']> },
7070
});
7171

7272
export type FormProps = Partial<ExtractPropTypes<ReturnType<typeof formProps>>>;

components/form/FormItemLabel.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ export interface FormItemLabelProps {
1818
requiredMark?: RequiredMark;
1919
required?: boolean;
2020
prefixCls: string;
21-
onClick: Function;
21+
onClick: [Function, Function[]];
2222
}
2323

2424
const FormItemLabel: FunctionalComponent<FormItemLabelProps> = (props, { slots, emit, attrs }) => {

components/input-number/src/InputNumber.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -65,17 +65,17 @@ export const inputNumberProps = () => ({
6565
/** Syntactic sugar of `formatter`. Config decimal separator of display. */
6666
decimalSeparator: { type: String as PropType<string> },
6767

68-
onInput: { type: Function as PropType<(text: string) => void> },
69-
onChange: { type: Function as PropType<(value: ValueType) => void> },
70-
onPressEnter: { type: Function as PropType<KeyboardEventHandler> },
68+
onInput: { type: [Function, Array] as PropType<(text: string) => void> },
69+
onChange: { type: [Function, Array] as PropType<(value: ValueType) => void> },
70+
onPressEnter: { type: [Function, Array] as PropType<KeyboardEventHandler> },
7171

7272
onStep: {
7373
type: Function as PropType<
7474
(value: ValueType, info: { offset: ValueType; type: 'up' | 'down' }) => void
7575
>,
7676
},
77-
onBlur: { type: Function as PropType<(e: FocusEvent) => void> },
78-
onFocus: { type: Function as PropType<(e: FocusEvent) => void> },
77+
onBlur: { type: [Function, Array] as PropType<(e: FocusEvent) => void> },
78+
onFocus: { type: [Function, Array] as PropType<(e: FocusEvent) => void> },
7979
});
8080

8181
export default defineComponent({

components/input-number/src/StepHandler.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ export default defineComponent({
2121
prefixCls: String,
2222
upDisabled: Boolean,
2323
downDisabled: Boolean,
24-
onStep: { type: Function as PropType<(up: boolean) => void> },
24+
onStep: { type: [Function, Array] as PropType<(up: boolean) => void> },
2525
},
2626
slots: ['upNode', 'downNode'],
2727
setup(props, { slots, emit }) {

components/input/Group.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ export default defineComponent({
1111
prefixCls: String,
1212
size: { type: String as PropType<SizeType> },
1313
compact: { type: Boolean, default: undefined },
14-
onMouseenter: { type: Function as PropType<MouseEventHandler> },
15-
onMouseleave: { type: Function as PropType<MouseEventHandler> },
16-
onFocus: { type: Function as PropType<FocusEventHandler> },
17-
onBlur: { type: Function as PropType<FocusEventHandler> },
14+
onMouseenter: { type: [Function, Array] as PropType<MouseEventHandler> },
15+
onMouseleave: { type: [Function, Array] as PropType<MouseEventHandler> },
16+
onFocus: { type: [Function, Array] as PropType<FocusEventHandler> },
17+
onBlur: { type: [Function, Array] as PropType<FocusEventHandler> },
1818
},
1919
setup(props, { slots }) {
2020
const { prefixCls, direction } = useConfigInject('input-group', props);

components/input/inputProps.ts

+13-11
Original file line numberDiff line numberDiff line change
@@ -69,14 +69,14 @@ const inputProps = () => ({
6969
bordered: { type: Boolean, default: undefined },
7070
showCount: { type: [Boolean, Object] as PropType<boolean | ShowCountProps> },
7171
htmlSize: Number,
72-
onPressEnter: Function as PropType<KeyboardEventHandler>,
73-
onKeydown: Function as PropType<KeyboardEventHandler>,
74-
onKeyup: Function as PropType<KeyboardEventHandler>,
75-
onFocus: Function as PropType<FocusEventHandler>,
76-
onBlur: Function as PropType<FocusEventHandler>,
77-
onChange: Function as PropType<ChangeEventHandler>,
78-
onInput: Function as PropType<ChangeEventHandler>,
79-
'onUpdate:value': Function as PropType<(val: string) => void>,
72+
onPressEnter: [Function, Array] as PropType<KeyboardEventHandler>,
73+
onKeydown: [Function, Array] as PropType<KeyboardEventHandler>,
74+
onKeyup: [Function, Array] as PropType<KeyboardEventHandler>,
75+
onFocus: [Function, Array] as PropType<FocusEventHandler>,
76+
onBlur: [Function, Array] as PropType<FocusEventHandler>,
77+
onChange: [Function, Array] as PropType<ChangeEventHandler>,
78+
onInput: [Function, Array] as PropType<ChangeEventHandler>,
79+
'onUpdate:value': [Function, Array] as PropType<(val: string) => void>,
8080
valueModifiers: Object,
8181
hidden: Boolean,
8282
});
@@ -95,9 +95,11 @@ const textAreaProps = () => ({
9595
rows: Number,
9696
autosize: { type: [Boolean, Object] as PropType<boolean | AutoSizeType>, default: undefined },
9797
autoSize: { type: [Boolean, Object] as PropType<boolean | AutoSizeType>, default: undefined },
98-
onResize: { type: Function as PropType<(size: { width: number; height: number }) => void> },
99-
onCompositionstart: Function as PropType<CompositionEventHandler>,
100-
onCompositionend: Function as PropType<CompositionEventHandler>,
98+
onResize: {
99+
type: [Function, Array] as PropType<(size: { width: number; height: number }) => void>,
100+
},
101+
onCompositionstart: [Function, Array] as PropType<CompositionEventHandler>,
102+
onCompositionend: [Function, Array] as PropType<CompositionEventHandler>,
101103
valueModifiers: Object,
102104
});
103105

components/layout/Sider.tsx

+2-2
Original file line numberDiff line numberDiff line change
@@ -38,8 +38,8 @@ export const siderProps = () => ({
3838
collapsedWidth: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
3939
breakpoint: PropTypes.oneOf(tuple('xs', 'sm', 'md', 'lg', 'xl', 'xxl', 'xxxl')),
4040
theme: PropTypes.oneOf(tuple('light', 'dark')).def('dark'),
41-
onBreakpoint: Function as PropType<(broken: boolean) => void>,
42-
onCollapse: Function as PropType<(collapsed: boolean, type: CollapseType) => void>,
41+
onBreakpoint: [Function, Array] as PropType<(broken: boolean) => void>,
42+
onCollapse: [Function, Array] as PropType<(collapsed: boolean, type: CollapseType) => void>,
4343
});
4444

4545
export type SiderProps = Partial<ExtractPropTypes<ReturnType<typeof siderProps>>>;

components/menu/src/Menu.tsx

+9-9
Original file line numberDiff line numberDiff line change
@@ -68,16 +68,16 @@ export const menuProps = () => ({
6868
getPopupContainer: Function as PropType<(node: HTMLElement) => HTMLElement>,
6969

7070
expandIcon: Function as PropType<(p?: { isOpen: boolean; [key: string]: any }) => any>,
71-
onOpenChange: Function as PropType<(keys: Key[]) => void>,
72-
onSelect: Function as PropType<SelectEventHandler>,
73-
onDeselect: Function as PropType<SelectEventHandler>,
71+
onOpenChange: [Function, Array] as PropType<(keys: Key[]) => void>,
72+
onSelect: [Function, Array] as PropType<SelectEventHandler>,
73+
onDeselect: [Function, Array] as PropType<SelectEventHandler>,
7474
onClick: [Function, Array] as PropType<MenuClickEventHandler>,
75-
onFocus: Function as PropType<FocusEventHandler>,
76-
onBlur: Function as PropType<FocusEventHandler>,
77-
onMousedown: Function as PropType<MouseEventHandler>,
78-
'onUpdate:openKeys': Function as PropType<(keys: Key[]) => void>,
79-
'onUpdate:selectedKeys': Function as PropType<(keys: Key[]) => void>,
80-
'onUpdate:activeKey': Function as PropType<(key: Key) => void>,
75+
onFocus: [Function, Array] as PropType<FocusEventHandler>,
76+
onBlur: [Function, Array] as PropType<FocusEventHandler>,
77+
onMousedown: [Function, Array] as PropType<MouseEventHandler>,
78+
'onUpdate:openKeys': [Function, Array] as PropType<(keys: Key[]) => void>,
79+
'onUpdate:selectedKeys': [Function, Array] as PropType<(keys: Key[]) => void>,
80+
'onUpdate:activeKey': [Function, Array] as PropType<(key: Key) => void>,
8181
});
8282

8383
export type MenuProps = Partial<ExtractPropTypes<ReturnType<typeof menuProps>>>;

components/menu/src/MenuItem.tsx

+5-5
Original file line numberDiff line numberDiff line change
@@ -21,11 +21,11 @@ export const menuItemProps = () => ({
2121
danger: Boolean,
2222
title: { type: [String, Boolean], default: undefined },
2323
icon: PropTypes.any,
24-
onMouseenter: Function as PropType<MouseEventHandler>,
25-
onMouseleave: Function as PropType<MouseEventHandler>,
26-
onClick: Function as PropType<MouseEventHandler>,
27-
onKeydown: Function as PropType<MouseEventHandler>,
28-
onFocus: Function as PropType<MouseEventHandler>,
24+
onMouseenter: [Function, Array] as PropType<MouseEventHandler>,
25+
onMouseleave: [Function, Array] as PropType<MouseEventHandler>,
26+
onClick: [Function, Array] as PropType<MouseEventHandler>,
27+
onKeydown: [Function, Array] as PropType<MouseEventHandler>,
28+
onFocus: [Function, Array] as PropType<MouseEventHandler>,
2929
});
3030

3131
export type MenuItemProps = Partial<ExtractPropTypes<ReturnType<typeof menuItemProps>>>;

components/menu/src/PopupTrigger.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export default defineComponent({
2626
popupClassName: String,
2727
popupOffset: Array as PropType<number[]>,
2828
disabled: Boolean,
29-
onVisibleChange: Function as PropType<(visible: boolean) => void>,
29+
onVisibleChange: [Function, Array] as PropType<(visible: boolean) => void>,
3030
},
3131
slots: ['popup'],
3232
emits: ['visibleChange'],

components/menu/src/SubMenu.tsx

+3-3
Original file line numberDiff line numberDiff line change
@@ -34,9 +34,9 @@ export const subMenuProps = () => ({
3434
internalPopupClose: Boolean,
3535
eventKey: String,
3636
expandIcon: Function as PropType<(p?: { isOpen: boolean; [key: string]: any }) => any>,
37-
onMouseenter: Function as PropType<MouseEventHandler>,
38-
onMouseleave: Function as PropType<MouseEventHandler>,
39-
onTitleClick: Function as PropType<(e: MouseEvent, key: Key) => void>,
37+
onMouseenter: [Function, Array] as PropType<MouseEventHandler>,
38+
onMouseleave: [Function, Array] as PropType<MouseEventHandler>,
39+
onTitleClick: [Function, Array] as PropType<(e: MouseEvent, key: Key) => void>,
4040
});
4141

4242
export type SubMenuProps = Partial<ExtractPropTypes<ReturnType<typeof subMenuProps>>>;

components/modal/Modal.tsx

+4-4
Original file line numberDiff line numberDiff line change
@@ -41,10 +41,10 @@ export const modalProps = () => ({
4141
title: PropTypes.any,
4242
closable: { type: Boolean, default: undefined },
4343
closeIcon: PropTypes.any,
44-
onOk: Function as PropType<(e: MouseEvent) => void>,
45-
onCancel: Function as PropType<(e: MouseEvent) => void>,
46-
'onUpdate:visible': Function as PropType<(visible: boolean) => void>,
47-
onChange: Function as PropType<(visible: boolean) => void>,
44+
onOk: [Function, Array] as PropType<(e: MouseEvent) => void>,
45+
onCancel: [Function, Array] as PropType<(e: MouseEvent) => void>,
46+
'onUpdate:visible': [Function, Array] as PropType<(visible: boolean) => void>,
47+
onChange: [Function, Array] as PropType<(visible: boolean) => void>,
4848
afterClose: Function as PropType<() => void>,
4949
centered: { type: Boolean, default: undefined },
5050
width: [String, Number],

components/page-header/index.tsx

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export const pageHeaderProps = () => ({
2626
extra: PropTypes.any,
2727
avatar: PropTypes.object,
2828
ghost: { type: Boolean, default: undefined },
29-
onBack: Function as PropType<MouseEventHandler>,
29+
onBack: [Function, Array] as PropType<MouseEventHandler>,
3030
});
3131

3232
export type PageHeaderProps = Partial<ExtractPropTypes<ReturnType<typeof pageHeaderProps>>>;

0 commit comments

Comments
 (0)