From c8dbd2422c47fddd6811fbf2cad030f7b15a4271 Mon Sep 17 00:00:00 2001 From: Ryan Wang Date: Fri, 17 Feb 2023 14:52:13 +0800 Subject: [PATCH] feat: add layer-closeable prop for modal (#861) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit #### What type of PR is this? /kind feature #### What this PR does / why we need it: VModal 组件支持设置是否允许点击蒙层以关闭模态框,并将所有包含表单的模态框设置为不允许点击蒙层关闭。 #### Which issue(s) this PR fixes: Fixes https://github.com/halo-dev/halo/issues/3328 #### Screenshots: ![2023-02-17 12 08 56](https://user-images.githubusercontent.com/21301288/219547318-d7c59742-8546-4bc8-9d49-fcff4053602f.gif) #### Special notes for your reviewer: 测试方式: 1. 打开 Console 端任意一个表单模态框,测试点击表单外部区域是否会关闭弹框。 #### Does this PR introduce a user-facing change? ```release-note 优化 Console 端部分包含表单的模态框,默认不允许点击外部区域关闭模态框。 ``` --- .../src/components/dialog/Dialog.vue | 7 ++++- .../components/src/components/modal/Modal.vue | 28 +++++++++++++++++-- .../global-search/GlobalSearchModal.vue | 1 + src/components/preview/UrlPreviewModal.vue | 1 + .../components/AttachmentDetailModal.vue | 1 + .../components/AttachmentPoliciesModal.vue | 1 + .../components/AttachmentSelectorModal.vue | 1 + .../posts/components/PostPreviewModal.vue | 1 + src/modules/dashboard/Dashboard.vue | 1 + 9 files changed, 39 insertions(+), 3 deletions(-) diff --git a/packages/components/src/components/dialog/Dialog.vue b/packages/components/src/components/dialog/Dialog.vue index 5ca6c389..7a273b1c 100644 --- a/packages/components/src/components/dialog/Dialog.vue +++ b/packages/components/src/components/dialog/Dialog.vue @@ -90,7 +90,12 @@ const handleClose = () => { };