add split panel props

This commit is contained in:
Sergio Crisostomo 2018-01-17 13:23:10 +01:00
parent 63bd0f7d3f
commit 435bf7814a
2 changed files with 14 additions and 1 deletions

View file

@ -21,9 +21,11 @@
:current-view="currentView" :current-view="currentView"
:date-prefix-cls="datePrefixCls"></date-panel-label> :date-prefix-cls="datePrefixCls"></date-panel-label>
<span <span
v-if="splitPanels"
:class="iconBtnCls('next', '-double')" :class="iconBtnCls('next', '-double')"
@click="nextYear('left')"><Icon type="ios-arrow-right"></Icon></span> @click="nextYear('left')"><Icon type="ios-arrow-right"></Icon></span>
<span <span
v-if="splitPanels"
:class="iconBtnCls('next')" :class="iconBtnCls('next')"
@click="nextMonth('left')" @click="nextMonth('left')"
v-show="currentView === 'date'"><Icon type="ios-arrow-right"></Icon></span> v-show="currentView === 'date'"><Icon type="ios-arrow-right"></Icon></span>
@ -45,9 +47,11 @@
<div :class="[prefixCls + '-content', prefixCls + '-content-right']" v-show="!isTime"> <div :class="[prefixCls + '-content', prefixCls + '-content-right']" v-show="!isTime">
<div :class="[datePrefixCls + '-header']" v-show="currentView !== 'time'"> <div :class="[datePrefixCls + '-header']" v-show="currentView !== 'time'">
<span <span
v-if="splitPanels"
:class="iconBtnCls('prev', '-double')" :class="iconBtnCls('prev', '-double')"
@click="prevYear('right')"><Icon type="ios-arrow-left"></Icon></span> @click="prevYear('right')"><Icon type="ios-arrow-left"></Icon></span>
<span <span
v-if="splitPanels"
:class="iconBtnCls('prev')" :class="iconBtnCls('prev')"
@click="prevMonth('right')" @click="prevMonth('right')"
v-show="currentView === 'date'"><Icon type="ios-arrow-left"></Icon></span> v-show="currentView === 'date'"><Icon type="ios-arrow-left"></Icon></span>
@ -125,7 +129,11 @@
mixins: [ Mixin, Locale, DateMixin ], mixins: [ Mixin, Locale, DateMixin ],
components: { Icon, DateTable, YearTable, MonthTable, TimePicker, Confirm, datePanelLabel }, components: { Icon, DateTable, YearTable, MonthTable, TimePicker, Confirm, datePanelLabel },
props: { props: {
// in the mixin // more props in the mixin
splitPanels: {
type: Boolean,
default: false
},
}, },
data(){ data(){
const [minDate, maxDate] = this.value.map(date => date || initTimeDate()); const [minDate, maxDate] = this.value.map(date => date || initTimeDate());

View file

@ -40,6 +40,7 @@
:format="format" :format="format"
:value="internalValue" :value="internalValue"
:start-date="startDate" :start-date="startDate"
:split-panels="splitPanels"
v-bind="ownPickerProps" v-bind="ownPickerProps"
@ -205,6 +206,10 @@
type: Boolean, type: Boolean,
default: false default: false
}, },
splitPanels: {
type: Boolean,
default: false
},
startDate: { startDate: {
type: Date type: Date
}, },