From 91e67ae767701b2af7e3bac30d991fa683c8ffa8 Mon Sep 17 00:00:00 2001 From: huxiyang3 <1872591453@qq.com> Date: Wed, 30 Oct 2024 20:12:06 +0800 Subject: [PATCH] fix(dialog): closeOnClickOverlay default props --- src/packages/__VUE/dialog/doc.en-US.md | 2 +- src/packages/__VUE/dialog/doc.md | 2 +- src/packages/__VUE/dialog/doc.taro.md | 4 ++-- src/packages/__VUE/dialog/index.taro.vue | 2 +- src/packages/__VUE/dialog/index.vue | 5 ++++- 5 files changed, 9 insertions(+), 6 deletions(-) diff --git a/src/packages/__VUE/dialog/doc.en-US.md b/src/packages/__VUE/dialog/doc.en-US.md index 571e45f819..f4884b48c0 100644 --- a/src/packages/__VUE/dialog/doc.en-US.md +++ b/src/packages/__VUE/dialog/doc.en-US.md @@ -225,7 +225,7 @@ const teleportClick = (teleport) => { | title | Title | string | - | | content | Content, support HTML | string | - | | teleport | Specifies a target element where Dialog will be mounted | string | `"body"` | -| close-on-click-overlay | Whether to close when overlay is clicked | boolean | `true` | +| close-on-click-overlay | Whether to close when overlay is clicked | boolean | `false` | | no-footer | Hide bottom button bar | boolean | `false` | | no-ok-btn | Hide OK button | boolean | `false` | | no-cancel-btn | Hide cancel button | boolean | `false` | diff --git a/src/packages/__VUE/dialog/doc.md b/src/packages/__VUE/dialog/doc.md index 3e877faa69..52e9e52012 100644 --- a/src/packages/__VUE/dialog/doc.md +++ b/src/packages/__VUE/dialog/doc.md @@ -225,7 +225,7 @@ const teleportClick = (teleport) => { | title | 标题 | string | - | | content | 内容,支持 HTML 和组件 | string \| VNode | | | teleport | 指定挂载节点 | string | `"body"` | -| close-on-click-overlay | 点击蒙层是否关闭对话框 | boolean | `true` | +| close-on-click-overlay | 点击蒙层是否关闭对话框 | boolean | `false` | | no-footer | 是否隐藏底部按钮栏 | boolean | `false` | | no-ok-btn | 是否隐藏确定按钮 | boolean | `false` | | no-cancel-btn | 是否隐藏取消按钮 | boolean | `false` | diff --git a/src/packages/__VUE/dialog/doc.taro.md b/src/packages/__VUE/dialog/doc.taro.md index 5e9fcd9eb2..480864e44d 100644 --- a/src/packages/__VUE/dialog/doc.taro.md +++ b/src/packages/__VUE/dialog/doc.taro.md @@ -140,7 +140,7 @@ const verticalClick = () => { | title | 标题 | string | - | | content | 内容,支持 `HTML` 和组件 | string \| VNode | - | | teleport | 指定挂载节点 | string | `"body"` | -| close-on-click-overlay | 点击蒙层是否关闭对话框 | boolean | `true` | +| close-on-click-overlay | 点击蒙层是否关闭对话框 | boolean | `false` | | no-footer | 是否隐藏底部按钮栏 | boolean | `false` | | no-ok-btn | 是否隐藏确定按钮 | boolean | `false` | | no-cancel-btn | 是否隐藏取消按钮 | boolean | `false` | @@ -148,7 +148,7 @@ const verticalClick = () => { | ok-text | 确定按钮文案 | string | `”确 定“` | | cancel-auto-close | 取消按钮是否默认关闭弹窗 | boolean | `true` | | ok-auto-close`4.2.1` | 确认按钮是否默认关闭弹窗 | boolean | `true` | -| text-align | 文字对齐方向,可选值同 `css` 的 `text-align ` | string | `"center"` | +| text-align | 文字对齐方向,可选值同 `css` 的 `text-align` | string | `"center"` | | close-on-popstate | 是否在页面回退时自动关闭 | boolean | `false` | | lock-scroll | 背景是否锁定 | boolean | `true` | | footer-direction | 使用横纵方向 可选值 `horizontal`、`vertical` | string | `horizontal` | diff --git a/src/packages/__VUE/dialog/index.taro.vue b/src/packages/__VUE/dialog/index.taro.vue index 70492f3a2e..210bfe7eed 100644 --- a/src/packages/__VUE/dialog/index.taro.vue +++ b/src/packages/__VUE/dialog/index.taro.vue @@ -69,7 +69,7 @@ export default create({ ...popupProps, closeOnClickOverlay: { type: Boolean, - default: true + default: false }, title: { type: String, diff --git a/src/packages/__VUE/dialog/index.vue b/src/packages/__VUE/dialog/index.vue index 1be39d87cc..833728aba1 100644 --- a/src/packages/__VUE/dialog/index.vue +++ b/src/packages/__VUE/dialog/index.vue @@ -69,7 +69,7 @@ export default create({ ...popupProps, closeOnClickOverlay: { type: Boolean, - default: true + default: false }, title: { type: String, @@ -182,7 +182,10 @@ export default create({ } const onClickOverlay = () => { + console.log(1) + console.log(props.closeOnClickOverlay) if (props.closeOnClickOverlay) { + console.log(2) closed('') } }