From c7de65ebba53941771153f18b184d3d4d31c0dbf Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=97=A0=E6=9C=A8?= Date: Mon, 28 Jun 2021 18:10:26 +0800 Subject: [PATCH] fix(modal): `setModalProps` support `defaultFullscreen` MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复setModalProps不支持设置defaultFullscreen的问题 --- src/components/Modal/src/BasicModal.vue | 8 ++++++-- src/components/Modal/src/typing.ts | 1 + 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/src/components/Modal/src/BasicModal.vue b/src/components/Modal/src/BasicModal.vue index b599f895..03cede18 100644 --- a/src/components/Modal/src/BasicModal.vue +++ b/src/components/Modal/src/BasicModal.vue @@ -187,8 +187,12 @@ function setModalProps(props: Partial): void { // Keep the last setModalProps propsRef.value = deepMerge(unref(propsRef) || ({} as any), props); - if (!Reflect.has(props, 'visible')) return; - visibleRef.value = !!props.visible; + if (Reflect.has(props, 'visible')) { + visibleRef.value = !!props.visible; + } + if (Reflect.has(props, 'defaultFullscreen')) { + fullScreenRef.value = !!props.defaultFullscreen; + } } function handleOk(e: Event) { diff --git a/src/components/Modal/src/typing.ts b/src/components/Modal/src/typing.ts index 71aa9ae9..36a7e7cd 100644 --- a/src/components/Modal/src/typing.ts +++ b/src/components/Modal/src/typing.ts @@ -39,6 +39,7 @@ export interface ModalProps { // 是否可以进行全屏 canFullscreen?: boolean; + defaultFullscreen?: boolean; visible?: boolean; // 温馨提醒信息 helpMessage: string | string[];