update DateTimePicker

update DateTimePicker
This commit is contained in:
梁灏 2016-12-30 11:34:01 +08:00
parent 62c7f99780
commit a8571a5fa1
3 changed files with 18 additions and 0 deletions

View file

@ -64,6 +64,7 @@
v-ref:time-picker v-ref:time-picker
:date="date" :date="date"
:value="value" :value="value"
show-date
@on-pick="handleTimePick"></time-picker> @on-pick="handleTimePick"></time-picker>
</div> </div>
<Confirm <Confirm

View file

@ -1,6 +1,7 @@
<template> <template>
<div :class="[prefixCls + '-body-wrapper']"> <div :class="[prefixCls + '-body-wrapper']">
<div :class="[prefixCls + '-body']"> <div :class="[prefixCls + '-body']">
<div :class="[timePrefixCls + '-header']" v-if="showDate">{{ visibleDate }}</div>
<div :class="[prefixCls + '-content']"> <div :class="[prefixCls + '-content']">
<time-spinner <time-spinner
v-ref:time-spinner v-ref:time-spinner
@ -44,6 +45,10 @@
}, },
value: { value: {
default: '' default: ''
},
showDate: {
type: Boolean,
default: false
} }
}, },
data () { data () {
@ -64,6 +69,10 @@
computed: { computed: {
showSeconds () { showSeconds () {
return (this.format || '').indexOf('ss') !== -1; return (this.format || '').indexOf('ss') !== -1;
},
visibleDate () {
const date = this.date;
return `${date.getFullYear()}${date.getMonth() + 1}`;
} }
}, },
watch: { watch: {

View file

@ -135,7 +135,15 @@
} }
&-list { &-list {
width: @time-picker-cells-width-with-date-base; width: @time-picker-cells-width-with-date-base;
max-height: 216px;
&:first-child{
border-radius: 0;
}
&:last-child{
border-radius: 0;
}
ul{ ul{
padding: 0 0 192px 0;
li{ li{
padding: 0 0 0 28px; padding: 0 0 0 28px;
} }