fixed #153
This commit is contained in:
梁灏 2016-12-29 12:11:22 +08:00
parent b27687d35f
commit 4db5926d6b
5 changed files with 25 additions and 39 deletions

View file

@ -1,17 +1,17 @@
<template>
<div :class="classes">
<div :class="[prefixCls+ '-list']" v-el:hours>
<ul @click="handleClickHours">
<ul :class="[prefixCls + '-ul']" @click="handleClickHours">
<li :class="getCellCls(item)" v-for="item in hoursList" v-show="!item.hide" :index="$index">{{ formatTime(item.text) }}</li>
</ul>
</div>
<div :class="[prefixCls+ '-list']" v-el:minutes>
<ul @click="handleClickMinutes">
<ul :class="[prefixCls + '-ul']" @click="handleClickMinutes">
<li :class="getCellCls(item)" v-for="item in minutesList" v-show="!item.hide" :index="$index">{{ formatTime(item.text) }}</li>
</ul>
</div>
<div :class="[prefixCls+ '-list']" v-show="showSeconds" v-el:seconds>
<ul @click="handleClickSeconds">
<ul :class="[prefixCls + '-ul']" @click="handleClickSeconds">
<li :class="getCellCls(item)" v-for="item in secondsList" v-show="!item.hide" :index="$index">{{ formatTime(item.text) }}</li>
</ul>
</div>
@ -155,11 +155,8 @@
const data = {};
data[type] = cell.text;
this.$emit('on-change', data);
// const from = this.$els[type].scrollTop;
// const to = 24 * this.getScrollIndex(type, cell.text);
// scrollTop(this.$els[type], from, to, 500);
}
this.$emit('on-pick-click');
},
scroll (type, index) {
const from = this.$els[type].scrollTop;

View file

@ -449,9 +449,9 @@
TYPE_VALUE_RESOLVER_MAP['default']
).parser;
if (type === 'time' && !(val instanceof Date)) {
if (val && type === 'time' && !(val instanceof Date)) {
val = parser(val, this.format || DEFAULT_FORMATS[type]);
} else if (type === 'timerange' && Array.isArray(val) && val.length === 2 && !(val[0] instanceof Date) && !(val[1] instanceof Date)) {
} else if (val && type === 'timerange' && Array.isArray(val) && val.length === 2 && !(val[0] instanceof Date) && !(val[1] instanceof Date)) {
val = val.join(RANGE_SEPARATOR);
val = parser(val, this.format || DEFAULT_FORMATS[type]);
}

View file

@ -48,13 +48,13 @@
}
.loop-grid-columns(@index, @class) when (@index = 0) {
.@{col-prefix-cls}@{class}-@{index} {
.@{col-prefix-cls}-span@{class}-@{index} {
display: none;
}
.@{col-prefix-cls}-push-@{index} {
.@{col-prefix-cls}@{class}-push-@{index} {
left: auto;
}
.@{col-prefix-cls}-pull-@{index} {
.@{col-prefix-cls}@{class}-pull-@{index} {
right: auto;
}
}