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
:date="date"
:value="value"
show-date
@on-pick="handleTimePick"></time-picker>
</div>
<Confirm

View file

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