From 2b82dcc3dd2dba678aba5e0533e0ff6af7c55b11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=99=88=E5=98=89=E6=B6=B5?= Date: Tue, 21 Jan 2020 22:52:00 +0800 Subject: [PATCH] feat(Calendar): add close-on-popstate prop --- src/calendar/README.md | 1 + src/calendar/README.zh-CN.md | 1 + src/calendar/index.js | 2 ++ 3 files changed, 4 insertions(+) diff --git a/src/calendar/README.md b/src/calendar/README.md index 432fde0be..94a852697 100644 --- a/src/calendar/README.md +++ b/src/calendar/README.md @@ -225,6 +225,7 @@ Set `poppable` to `false`, the calendar will be displayed directly on the page i | round | Whether to show round corner | *boolean* | `true` | | show-mark | Whether to show background month mark | *boolean* | `true` | | show-confirm | Whether to show confirm button | *boolean* | `true` | +| close-on-popstate `v2.4.4` | Whether to close when popstate | *boolean* | `false` | | close-on-click-overlay | Whether to close when click overlay | *boolean* | `true` | | safe-area-inset-bottom | Whether to enable bottom safe area adaptation | *boolean* | `true` | | confirm-text | Confirm button text | *string* | `Confirm` | diff --git a/src/calendar/README.zh-CN.md b/src/calendar/README.zh-CN.md index 521831c26..28f1fba4f 100644 --- a/src/calendar/README.zh-CN.md +++ b/src/calendar/README.zh-CN.md @@ -225,6 +225,7 @@ export default { | round | 是否显示圆角弹窗 | *boolean* | `true` | | show-mark | 是否显示月份背景水印 | *boolean* | `true` | | show-confirm | 是否展示确认按钮 | *boolean* | `true` | +| close-on-popstate `v2.4.4` | 是否在页面回退时自动关闭 | *boolean* | `false` | | close-on-click-overlay | 是否在点击遮罩层后关闭 | *boolean* | `true` | | safe-area-inset-bottom | 是否开启底部安全区适配,[详细说明](#/zh-CN/quickstart#di-bu-an-quan-qu-gua-pei) | *boolean* | `true` | | confirm-text | 确认按钮的文字 | *string* | `确定` | diff --git a/src/calendar/index.js b/src/calendar/index.js index 819bedfee..6dd74efd9 100644 --- a/src/calendar/index.js +++ b/src/calendar/index.js @@ -29,6 +29,7 @@ export default createComponent({ rangePrompt: String, defaultDate: [Date, Array], getContainer: [String, Function], + closeOnPopstate: Boolean, confirmDisabledText: String, type: { type: String, @@ -372,6 +373,7 @@ export default createComponent({ round={this.round} position={this.position} getContainer={this.getContainer} + closeOnPopstate={this.closeOnPopstate} closeOnClickOverlay={this.closeOnClickOverlay} onInput={this.togglePopup} >