@@ -32,6 +32,8 @@ export interface ModalProps {
3232 modalTitle ?: string ;
3333 width ?: string | number ;
3434 height ?: string | number ;
35+ minWidth ?: string | number ;
36+ minHeight ?: string | number ;
3537 maskClosable ?: boolean ;
3638 confirmText ?: string ;
3739 cancelText ?: string ;
@@ -100,6 +102,24 @@ class Modal extends ReactNextElement implements ModalProps {
100102 */
101103 @property ( { attribute : false } ) accessor height : string | number | undefined ;
102104
105+ /**
106+ * 最小宽度
107+ *
108+ * @default "520px"
109+ */
110+ @property ( { attribute : false } ) accessor minWidth :
111+ | string
112+ | number
113+ | undefined ;
114+
115+ /**
116+ * 最小高度
117+ */
118+ @property ( { attribute : false } ) accessor minHeight :
119+ | string
120+ | number
121+ | undefined ;
122+
103123 /**
104124 * 点击遮罩层是否关闭模态框
105125 */
@@ -285,6 +305,8 @@ class Modal extends ReactNextElement implements ModalProps {
285305 modalTitle = { this . modalTitle }
286306 width = { this . width }
287307 height = { this . height }
308+ minWidth = { this . minWidth }
309+ minHeight = { this . minHeight }
288310 maskClosable = { this . maskClosable }
289311 visible = { this . visible }
290312 confirmText = { this . confirmText }
@@ -323,6 +345,8 @@ function ModalComponent({
323345 modalTitle,
324346 width,
325347 height,
348+ minWidth,
349+ minHeight,
326350 maskClosable,
327351 confirmText = t ( K . CONFIRM ) ,
328352 cancelText = t ( K . CANCEL ) ,
@@ -571,10 +595,12 @@ function ModalComponent({
571595 className = { classNames ( "modal" , {
572596 fullscreen,
573597 "has-sidebar" : hasSidebarContent ,
574- "has-height" : ! ! height || fullscreen ,
598+ "has-height" : ! ! height || ! ! minHeight || fullscreen ,
575599 } ) }
576600 style = {
577- fullscreen ? { width : "100%" , height : "100%" } : { width, height }
601+ fullscreen
602+ ? { width : "100%" , height : "100%" }
603+ : { width, height, minWidth, minHeight }
578604 }
579605 >
580606 < div
0 commit comments