Skip to content

Commit

Permalink
fix(dialog): closeOnClickOverlay default props
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-huxiyang committed Oct 30, 2024
1 parent 48a4887 commit 91e67ae
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/packages/__VUE/dialog/doc.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` |
Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/dialog/doc.md
Original file line number Diff line number Diff line change
Expand Up @@ -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` |
Expand Down
4 changes: 2 additions & 2 deletions src/packages/__VUE/dialog/doc.taro.md
Original file line number Diff line number Diff line change
Expand Up @@ -140,15 +140,15 @@ 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` |
| cancel-text | 取消按钮文案 | string | `”取消“` |
| 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` |
Expand Down
2 changes: 1 addition & 1 deletion src/packages/__VUE/dialog/index.taro.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export default create({
...popupProps,
closeOnClickOverlay: {
type: Boolean,
default: true
default: false
},
title: {
type: String,
Expand Down
5 changes: 4 additions & 1 deletion src/packages/__VUE/dialog/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ export default create({
...popupProps,
closeOnClickOverlay: {
type: Boolean,
default: true
default: false
},
title: {
type: String,
Expand Down Expand Up @@ -182,7 +182,10 @@ export default create({
}
const onClickOverlay = () => {
console.log(1)
console.log(props.closeOnClickOverlay)
if (props.closeOnClickOverlay) {
console.log(2)
closed('')
}
}
Expand Down

0 comments on commit 91e67ae

Please sign in to comment.