From 0fd136966029f49fd0d7a92ccda057ed49c56460 Mon Sep 17 00:00:00 2001 From: 梁灏 Date: Tue, 27 Dec 2016 17:55:13 +0800 Subject: [PATCH] fixed DatePicker event when type = daterange --- src/components/date-picker/picker.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/date-picker/picker.vue b/src/components/date-picker/picker.vue index 6e5a6a8..c8956f5 100644 --- a/src/components/date-picker/picker.vue +++ b/src/components/date-picker/picker.vue @@ -414,7 +414,12 @@ TYPE_VALUE_RESOLVER_MAP['default'] ).formatter; - this.$emit('on-change', formatter(date, format)); + let newDate = formatter(date, format); + if (this.type === 'daterange') { + newDate = [newDate.split(RANGE_SEPARATOR)[0], newDate.split(RANGE_SEPARATOR)[1]]; + } + + this.$emit('on-change', newDate); } }, watch: { -- libgit2 0.21.4