diff --git a/src/calendar/README.md b/src/calendar/README.md index 480df2a4f..69c0d53e7 100644 --- a/src/calendar/README.md +++ b/src/calendar/README.md @@ -254,7 +254,7 @@ Following props are supported when the poppable is true | v-model | Whether to show calendar | _boolean_ | `false` | | position | Popup position, can be set to `top` `right` `left` | _string_ | `bottom` | | round | Whether to show round corner | _boolean_ | `true` | -| close-on-popstate `v2.4.4` | Whether to close when popstate | _boolean_ | `false` | +| close-on-popstate `v2.4.4` | Whether to close when popstate | _boolean_ | `true` | | 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` | | get-container `v2.4.4` | Return the mount node for Calendar | _string \| () => Element_ | - | diff --git a/src/calendar/README.zh-CN.md b/src/calendar/README.zh-CN.md index 32ff0cfbb..075b38fa9 100644 --- a/src/calendar/README.zh-CN.md +++ b/src/calendar/README.zh-CN.md @@ -256,7 +256,7 @@ export default { | v-model | 是否显示日历弹窗 | _boolean_ | `false` | | position | 弹出位置,可选值为 `top` `right` `left` | _string_ | `bottom` | | round | 是否显示圆角弹窗 | _boolean_ | `true` | -| close-on-popstate `v2.4.4` | 是否在页面回退时自动关闭 | _boolean_ | `false` | +| close-on-popstate `v2.4.4` | 是否在页面回退时自动关闭 | _boolean_ | `true` | | close-on-click-overlay | 是否在点击遮罩层后关闭 | _boolean_ | `true` | | safe-area-inset-bottom | 是否开启[底部安全区适配](#/zh-CN/quickstart#di-bu-an-quan-qu-gua-pei) | _boolean_ | `true` | | get-container `v2.4.4` | 指定挂载的节点,[用法示例](#/zh-CN/popup#zhi-ding-gua-zai-wei-zhi) | _string \| () => Element_ | - | diff --git a/src/calendar/index.js b/src/calendar/index.js index 7b70a65c1..e45415c84 100644 --- a/src/calendar/index.js +++ b/src/calendar/index.js @@ -33,48 +33,31 @@ export default createComponent({ defaultDate: [Date, Array], getContainer: [String, Function], allowSameDay: Boolean, - closeOnPopstate: Boolean, confirmDisabledText: String, - firstDayOfWeek: { - type: [Number, String], - default: 0, - validator: (val) => { - return val >= 0 && val <= 6; - }, - }, type: { type: String, default: 'single', }, - minDate: { - type: Date, - validator: isDate, - default: () => new Date(), - }, - maxDate: { - type: Date, - validator: isDate, - default() { - const now = new Date(); - return new Date(now.getFullYear(), now.getMonth() + 6, now.getDate()); - }, - }, - position: { - type: String, - default: 'bottom', - }, - rowHeight: { - type: [Number, String], - default: ROW_HEIGHT, - }, round: { type: Boolean, default: true, }, + position: { + type: String, + default: 'bottom', + }, poppable: { type: Boolean, default: true, }, + rowHeight: { + type: [Number, String], + default: ROW_HEIGHT, + }, + maxRange: { + type: [Number, String], + default: null, + }, lazyRender: { type: Boolean, default: true, @@ -95,7 +78,7 @@ export default createComponent({ type: Boolean, default: true, }, - safeAreaInsetBottom: { + closeOnPopstate: { type: Boolean, default: true, }, @@ -103,9 +86,27 @@ export default createComponent({ type: Boolean, default: true, }, - maxRange: { + safeAreaInsetBottom: { + type: Boolean, + default: true, + }, + minDate: { + type: Date, + validator: isDate, + default: () => new Date(), + }, + maxDate: { + type: Date, + validator: isDate, + default() { + const now = new Date(); + return new Date(now.getFullYear(), now.getMonth() + 6, now.getDate()); + }, + }, + firstDayOfWeek: { type: [Number, String], - default: null, + default: 0, + validator: (val) => val >= 0 && val <= 6, }, },