diff --git a/datepicker/calendar-panel.vue b/datepicker/calendar-panel.vue index aab4cb1..3422d43 100644 --- a/datepicker/calendar-panel.vue +++ b/datepicker/calendar-panel.vue @@ -134,6 +134,9 @@ export default { if (!options) { return [] } + if (typeof options === 'function') { + return options() || [] + } const start = parseTime(options.start) const end = parseTime(options.end) const step = parseTime(options.step) diff --git a/datepicker/index.vue b/datepicker/index.vue index 15f2eef..d280f4d 100644 --- a/datepicker/index.vue +++ b/datepicker/index.vue @@ -123,9 +123,9 @@ export default { validator: val => val >= 0 && val <= 60 }, timePickerOptions: { - type: Object, + type: [Object, Function], default () { - return {} + return null } }, confirm: {