Commit c7de65ebba53941771153f18b184d3d4d31c0dbf
1 parent
829b366c
fix(modal): `setModalProps` support `defaultFullscreen`
修复setModalProps不支持设置defaultFullscreen的问题
Showing
2 changed files
with
7 additions
and
2 deletions
src/components/Modal/src/BasicModal.vue
@@ -187,8 +187,12 @@ | @@ -187,8 +187,12 @@ | ||
187 | function setModalProps(props: Partial<ModalProps>): void { | 187 | function setModalProps(props: Partial<ModalProps>): void { |
188 | // Keep the last setModalProps | 188 | // Keep the last setModalProps |
189 | propsRef.value = deepMerge(unref(propsRef) || ({} as any), props); | 189 | propsRef.value = deepMerge(unref(propsRef) || ({} as any), props); |
190 | - if (!Reflect.has(props, 'visible')) return; | ||
191 | - visibleRef.value = !!props.visible; | 190 | + if (Reflect.has(props, 'visible')) { |
191 | + visibleRef.value = !!props.visible; | ||
192 | + } | ||
193 | + if (Reflect.has(props, 'defaultFullscreen')) { | ||
194 | + fullScreenRef.value = !!props.defaultFullscreen; | ||
195 | + } | ||
192 | } | 196 | } |
193 | 197 | ||
194 | function handleOk(e: Event) { | 198 | function handleOk(e: Event) { |
src/components/Modal/src/typing.ts
@@ -39,6 +39,7 @@ export interface ModalProps { | @@ -39,6 +39,7 @@ export interface ModalProps { | ||
39 | 39 | ||
40 | // 是否可以进行全屏 | 40 | // 是否可以进行全屏 |
41 | canFullscreen?: boolean; | 41 | canFullscreen?: boolean; |
42 | + defaultFullscreen?: boolean; | ||
42 | visible?: boolean; | 43 | visible?: boolean; |
43 | // 温馨提醒信息 | 44 | // 温馨提醒信息 |
44 | helpMessage: string | string[]; | 45 | helpMessage: string | string[]; |