Commit 435bf7814a6ad6aab47a357ceae8cd28480fbb57
1 parent
63bd0f7d
add split panel props
Showing
2 changed files
with
14 additions
and
1 deletions
Show diff stats
src/components/date-picker/panel/Date/date-range.vue
@@ -21,9 +21,11 @@ | @@ -21,9 +21,11 @@ | ||
21 | :current-view="currentView" | 21 | :current-view="currentView" |
22 | :date-prefix-cls="datePrefixCls"></date-panel-label> | 22 | :date-prefix-cls="datePrefixCls"></date-panel-label> |
23 | <span | 23 | <span |
24 | + v-if="splitPanels" | ||
24 | :class="iconBtnCls('next', '-double')" | 25 | :class="iconBtnCls('next', '-double')" |
25 | @click="nextYear('left')"><Icon type="ios-arrow-right"></Icon></span> | 26 | @click="nextYear('left')"><Icon type="ios-arrow-right"></Icon></span> |
26 | <span | 27 | <span |
28 | + v-if="splitPanels" | ||
27 | :class="iconBtnCls('next')" | 29 | :class="iconBtnCls('next')" |
28 | @click="nextMonth('left')" | 30 | @click="nextMonth('left')" |
29 | v-show="currentView === 'date'"><Icon type="ios-arrow-right"></Icon></span> | 31 | v-show="currentView === 'date'"><Icon type="ios-arrow-right"></Icon></span> |
@@ -45,9 +47,11 @@ | @@ -45,9 +47,11 @@ | ||
45 | <div :class="[prefixCls + '-content', prefixCls + '-content-right']" v-show="!isTime"> | 47 | <div :class="[prefixCls + '-content', prefixCls + '-content-right']" v-show="!isTime"> |
46 | <div :class="[datePrefixCls + '-header']" v-show="currentView !== 'time'"> | 48 | <div :class="[datePrefixCls + '-header']" v-show="currentView !== 'time'"> |
47 | <span | 49 | <span |
50 | + v-if="splitPanels" | ||
48 | :class="iconBtnCls('prev', '-double')" | 51 | :class="iconBtnCls('prev', '-double')" |
49 | @click="prevYear('right')"><Icon type="ios-arrow-left"></Icon></span> | 52 | @click="prevYear('right')"><Icon type="ios-arrow-left"></Icon></span> |
50 | <span | 53 | <span |
54 | + v-if="splitPanels" | ||
51 | :class="iconBtnCls('prev')" | 55 | :class="iconBtnCls('prev')" |
52 | @click="prevMonth('right')" | 56 | @click="prevMonth('right')" |
53 | v-show="currentView === 'date'"><Icon type="ios-arrow-left"></Icon></span> | 57 | v-show="currentView === 'date'"><Icon type="ios-arrow-left"></Icon></span> |
@@ -125,7 +129,11 @@ | @@ -125,7 +129,11 @@ | ||
125 | mixins: [ Mixin, Locale, DateMixin ], | 129 | mixins: [ Mixin, Locale, DateMixin ], |
126 | components: { Icon, DateTable, YearTable, MonthTable, TimePicker, Confirm, datePanelLabel }, | 130 | components: { Icon, DateTable, YearTable, MonthTable, TimePicker, Confirm, datePanelLabel }, |
127 | props: { | 131 | props: { |
128 | - // in the mixin | 132 | + // more props in the mixin |
133 | + splitPanels: { | ||
134 | + type: Boolean, | ||
135 | + default: false | ||
136 | + }, | ||
129 | }, | 137 | }, |
130 | data(){ | 138 | data(){ |
131 | const [minDate, maxDate] = this.value.map(date => date || initTimeDate()); | 139 | const [minDate, maxDate] = this.value.map(date => date || initTimeDate()); |
src/components/date-picker/picker.vue
@@ -40,6 +40,7 @@ | @@ -40,6 +40,7 @@ | ||
40 | :format="format" | 40 | :format="format" |
41 | :value="internalValue" | 41 | :value="internalValue" |
42 | :start-date="startDate" | 42 | :start-date="startDate" |
43 | + :split-panels="splitPanels" | ||
43 | 44 | ||
44 | v-bind="ownPickerProps" | 45 | v-bind="ownPickerProps" |
45 | 46 | ||
@@ -205,6 +206,10 @@ | @@ -205,6 +206,10 @@ | ||
205 | type: Boolean, | 206 | type: Boolean, |
206 | default: false | 207 | default: false |
207 | }, | 208 | }, |
209 | + splitPanels: { | ||
210 | + type: Boolean, | ||
211 | + default: false | ||
212 | + }, | ||
208 | startDate: { | 213 | startDate: { |
209 | type: Date | 214 | type: Date |
210 | }, | 215 | }, |