From 59ee0a5ed7776a72fd7d96f2a3b5b1e533c7a7c3 Mon Sep 17 00:00:00 2001 From: mxie <15623530290@163.com> Date: Wed, 2 May 2018 16:01:26 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E8=87=AA=E5=AE=9A=E4=B9=89ti?= =?UTF-8?q?me-picker-option?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- datepicker/calendar-panel.vue | 3 +++ datepicker/index.vue | 4 ++-- 2 files changed, 5 insertions(+), 2 deletions(-) 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: {