fix: modal loading button not work

pull/2805/head
tanjinzhou 2020-09-07 13:49:12 +08:00
parent b616823353
commit 9257c1ea68
2 changed files with 11 additions and 9 deletions

View File

@ -66,10 +66,12 @@ export default {
render() {
const { type, loading, buttonProps } = this;
return (
<Button type={type} onClick={this.onClick} loading={loading} {...buttonProps}>
{getSlot(this)}
</Button>
);
const props = {
type,
onClick: this.onClick,
loading,
...buttonProps,
};
return <Button {...props}>{getSlot(this)}</Button>;
},
};

8
types/modal.d.ts vendored
View File

@ -82,13 +82,13 @@ export interface ModalOptions {
* The ok button props
* @type object
*/
okButtonProps?: Button;
okButtonProps?: Button.$props;
/**
* The cancel button props
* @type object
*/
cancelButtonProps?: Button;
cancelButtonProps?: Button.$props;
/**
* Title
@ -259,13 +259,13 @@ export declare class Modal extends AntdComponent {
* The ok button props, follow jsx rules
* @type object
*/
okButtonProps?: { props: Button; on: {} };
okButtonProps?: Button.$props;
/**
* The cancel button props, follow jsx rules
* @type object
*/
cancelButtonProps?: { props: Button; on: {} };
cancelButtonProps?: Button.$props;
/**
* The modal dialog's title