diff --git a/src/components/date-picker/panel/Date/date.vue b/src/components/date-picker/panel/Date/date.vue index 9a595b9..a5913b8 100644 --- a/src/components/date-picker/panel/Date/date.vue +++ b/src/components/date-picker/panel/Date/date.vue @@ -92,7 +92,11 @@ mixins: [ Mixin, Locale, DateMixin ], components: { Icon, DateTable, YearTable, MonthTable, TimePicker, Confirm, datePanelLabel }, props: { - // in the mixin + // more props in the mixin + multiple: { + type: Boolean, + default: false + } }, data () { const {selectionMode, value} = this; @@ -141,7 +145,7 @@ watch: { value (newVal) { this.dates = newVal; - this.panelDate = this.startDate || this.dates[0] || new Date(); + this.panelDate = this.startDate || (this.multiple ? this.dates[this.dates.length - 1] : this.dates[0]) || new Date(); }, currentView (currentView) { this.$emit('on-selection-mode-change', currentView); diff --git a/src/components/date-picker/picker.vue b/src/components/date-picker/picker.vue index 38fd92b..61aa3ca 100644 --- a/src/components/date-picker/picker.vue +++ b/src/components/date-picker/picker.vue @@ -47,6 +47,7 @@ :split-panels="splitPanels" :show-week-numbers="showWeekNumbers" :picker-type="type" + :multiple="multiple" :time-picker-options="timePickerOptions" -- libgit2 0.21.4