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() { render() {
const { type, loading, buttonProps } = this; const { type, loading, buttonProps } = this;
return ( const props = {
<Button type={type} onClick={this.onClick} loading={loading} {...buttonProps}> type,
{getSlot(this)} onClick: this.onClick,
</Button> 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 * The ok button props
* @type object * @type object
*/ */
okButtonProps?: Button; okButtonProps?: Button.$props;
/** /**
* The cancel button props * The cancel button props
* @type object * @type object
*/ */
cancelButtonProps?: Button; cancelButtonProps?: Button.$props;
/** /**
* Title * Title
@ -259,13 +259,13 @@ export declare class Modal extends AntdComponent {
* The ok button props, follow jsx rules * The ok button props, follow jsx rules
* @type object * @type object
*/ */
okButtonProps?: { props: Button; on: {} }; okButtonProps?: Button.$props;
/** /**
* The cancel button props, follow jsx rules * The cancel button props, follow jsx rules
* @type object * @type object
*/ */
cancelButtonProps?: { props: Button; on: {} }; cancelButtonProps?: Button.$props;
/** /**
* The modal dialog's title * The modal dialog's title