fix: modal add dialogStyle dialogClass #2285

pull/2275/head
tangjinzhou 2020-05-24 22:06:26 +08:00
parent ffc002f094
commit 1410dee61f
3 changed files with 6 additions and 4 deletions

@ -1 +1 @@
Subproject commit aba05e5d5f91583c536f44e95df5b9dbeb8482fe Subproject commit f3b049411f17e556d8795f40d41bfadb471ae630

View File

@ -218,8 +218,10 @@ export default {
visible, visible,
bodyProps, bodyProps,
forceRender, forceRender,
dialogStyle,
dialogClass,
} = this; } = this;
const dest = {}; const dest = { ...dialogStyle };
if (width !== undefined) { if (width !== undefined) {
dest.width = typeof width === 'number' ? `${width}px` : width; dest.width = typeof width === 'number' ? `${width}px` : width;
} }
@ -276,7 +278,7 @@ export default {
role="document" role="document"
ref="dialog" ref="dialog"
style={style} style={style}
class={cls} class={[cls, dialogClass]}
forceRender={forceRender} forceRender={forceRender}
onMousedown={this.onDialogMouseDown} onMousedown={this.onDialogMouseDown}
> >

View File

@ -33,7 +33,7 @@ function IDialogPropTypes() {
wrapProps: PropTypes.any, wrapProps: PropTypes.any,
getContainer: PropTypes.any, getContainer: PropTypes.any,
dialogStyle: PropTypes.object.def(() => ({})), dialogStyle: PropTypes.object.def(() => ({})),
dialogClass: PropTypes.object.def(() => ({})), dialogClass: PropTypes.object.def(''),
closeIcon: PropTypes.any, closeIcon: PropTypes.any,
forceRender: PropTypes.bool, forceRender: PropTypes.bool,
getOpenCount: PropTypes.func, getOpenCount: PropTypes.func,