feat(Caldenar): enable close-on-popstate by default (#6874)

This commit is contained in:
neverland 2020-07-25 15:01:24 +08:00 committed by GitHub
parent 0bae33de4c
commit e15abf4f0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 35 additions and 34 deletions

View File

@ -254,7 +254,7 @@ Following props are supported when the poppable is true
| v-model | Whether to show calendar | _boolean_ | `false` | | v-model | Whether to show calendar | _boolean_ | `false` |
| position | Popup position, can be set to `top` `right` `left` | _string_ | `bottom` | | position | Popup position, can be set to `top` `right` `left` | _string_ | `bottom` |
| round | Whether to show round corner | _boolean_ | `true` | | 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` | | 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` | | 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_ | - | | get-container `v2.4.4` | Return the mount node for Calendar | _string \| () => Element_ | - |

View File

@ -256,7 +256,7 @@ export default {
| v-model | 是否显示日历弹窗 | _boolean_ | `false` | | v-model | 是否显示日历弹窗 | _boolean_ | `false` |
| position | 弹出位置,可选值为 `top` `right` `left` | _string_ | `bottom` | | position | 弹出位置,可选值为 `top` `right` `left` | _string_ | `bottom` |
| round | 是否显示圆角弹窗 | _boolean_ | `true` | | 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` | | close-on-click-overlay | 是否在点击遮罩层后关闭 | _boolean_ | `true` |
| safe-area-inset-bottom | 是否开启[底部安全区适配](#/zh-CN/quickstart#di-bu-an-quan-qu-gua-pei) | _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_ | - | | get-container `v2.4.4` | 指定挂载的节点,[用法示例](#/zh-CN/popup#zhi-ding-gua-zai-wei-zhi) | _string \| () => Element_ | - |

View File

@ -33,48 +33,31 @@ export default createComponent({
defaultDate: [Date, Array], defaultDate: [Date, Array],
getContainer: [String, Function], getContainer: [String, Function],
allowSameDay: Boolean, allowSameDay: Boolean,
closeOnPopstate: Boolean,
confirmDisabledText: String, confirmDisabledText: String,
firstDayOfWeek: {
type: [Number, String],
default: 0,
validator: (val) => {
return val >= 0 && val <= 6;
},
},
type: { type: {
type: String, type: String,
default: 'single', 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: { round: {
type: Boolean, type: Boolean,
default: true, default: true,
}, },
position: {
type: String,
default: 'bottom',
},
poppable: { poppable: {
type: Boolean, type: Boolean,
default: true, default: true,
}, },
rowHeight: {
type: [Number, String],
default: ROW_HEIGHT,
},
maxRange: {
type: [Number, String],
default: null,
},
lazyRender: { lazyRender: {
type: Boolean, type: Boolean,
default: true, default: true,
@ -95,7 +78,7 @@ export default createComponent({
type: Boolean, type: Boolean,
default: true, default: true,
}, },
safeAreaInsetBottom: { closeOnPopstate: {
type: Boolean, type: Boolean,
default: true, default: true,
}, },
@ -103,9 +86,27 @@ export default createComponent({
type: Boolean, type: Boolean,
default: true, 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], type: [Number, String],
default: null, default: 0,
validator: (val) => val >= 0 && val <= 6,
}, },
}, },