diff --git a/src/components/date-picker/panel/date.vue b/src/components/date-picker/panel/date.vue index 7d37138..d10e247 100644 --- a/src/components/date-picker/panel/date.vue +++ b/src/components/date-picker/panel/date.vue @@ -64,6 +64,7 @@ v-ref:time-picker :date="date" :value="value" + :format="format" show-date @on-pick="handleTimePick"> @@ -109,7 +110,8 @@ year: null, month: null, confirm: false, - isTime: false + isTime: false, + format: 'yyyy-MM-dd' }; }, computed: { diff --git a/src/components/date-picker/panel/time.vue b/src/components/date-picker/panel/time.vue index f31cd29..7277d1f 100644 --- a/src/components/date-picker/panel/time.vue +++ b/src/components/date-picker/panel/time.vue @@ -49,13 +49,17 @@ showDate: { type: Boolean, default: false + }, + format: { + type: String, + default: 'HH:mm:ss' } }, data () { return { prefixCls: prefixCls, timePrefixCls: timePrefixCls, - format: 'HH:mm:ss', +// format: 'HH:mm:ss', hours: '', minutes: '', seconds: '', diff --git a/src/styles/components/time-picker.less b/src/styles/components/time-picker.less index 9ecd1e5..7f62e78 100644 --- a/src/styles/components/time-picker.less +++ b/src/styles/components/time-picker.less @@ -129,12 +129,20 @@ .@{picker-prefix-cls}-panel-content{ .@{time-picker-prefix-cls}{ &-cells{ - min-width: @time-picker-cells-width-with-date; + min-width: @time-picker-cells-width-with-date-with-seconds; &-with-seconds{ min-width: @time-picker-cells-width-with-date-with-seconds; + .@{time-picker-prefix-cls}-cells-list{ + width: @time-picker-cells-width-with-date-with-seconds / 3; + ul{ + li{ + padding: 0 0 0 28px; + } + } + } } &-list { - width: @time-picker-cells-width-with-date-base; + width: @time-picker-cells-width-with-date-with-seconds / 2; max-height: 216px; &:first-child{ border-radius: 0; @@ -145,7 +153,7 @@ ul{ padding: 0 0 192px 0; li{ - padding: 0 0 0 28px; + padding: 0 0 0 46px; } } } diff --git a/test/routers/date.vue b/test/routers/date.vue index 3578e55..6d48363 100644 --- a/test/routers/date.vue +++ b/test/routers/date.vue @@ -24,7 +24,7 @@ - + @@ -44,6 +44,7 @@ data () { return { // value: '2016-12-12 03:03:03', + value1: '2015-12-12 09:41', value: '03:12:01', value2: ['08:40:00', '09:40:00'], // value2: [new Date(), new Date()], -- libgit2 0.21.4