[Doc] DatetimePicker: usage of minTime/maxTime

This commit is contained in:
陈嘉涵 2018-03-22 16:46:06 +08:00
parent a0bed46a63
commit 75fb2544ff
4 changed files with 3 additions and 13 deletions

View File

@ -4,8 +4,6 @@
<van-datetime-picker <van-datetime-picker
v-model="currentDate1" v-model="currentDate1"
type="datetime" type="datetime"
:min-hour="minHour"
:max-hour="maxHour"
:min-date="minDate" :min-date="minDate"
:max-date="maxDate" :max-date="maxDate"
/> />
@ -33,7 +31,6 @@
type="time" type="time"
:min-hour="minHour" :min-hour="minHour"
:max-hour="maxHour" :max-hour="maxHour"
:min-date="minDate"
/> />
</demo-block> </demo-block>
</demo-section> </demo-section>

View File

@ -15,8 +15,6 @@ Vue.use(DatetimePicker);
<van-datetime-picker <van-datetime-picker
v-model="currentDate" v-model="currentDate"
type="datetime" type="datetime"
:min-hour="minHour"
:max-hour="maxHour"
:min-date="minDate" :min-date="minDate"
:max-date="maxDate" :max-date="maxDate"
/> />
@ -84,7 +82,6 @@ export default {
type="time" type="time"
:min-hour="minHour" :min-hour="minHour"
:max-hour="maxHour" :max-hour="maxHour"
:min-date="minDate"
/> />
``` ```

View File

@ -15,8 +15,6 @@ Vue.use(DatetimePicker);
<van-datetime-picker <van-datetime-picker
v-model="currentDate" v-model="currentDate"
type="datetime" type="datetime"
:min-hour="minHour"
:max-hour="maxHour"
:min-date="minDate" :min-date="minDate"
:max-date="maxDate" :max-date="maxDate"
/> />
@ -84,7 +82,6 @@ export default {
type="time" type="time"
:min-hour="minHour" :min-hour="minHour"
:max-hour="maxHour" :max-hour="maxHour"
:min-date="minDate"
/> />
``` ```
@ -102,11 +99,11 @@ export default {
| 参数 | 说明 | 类型 | 默认值 | 可选值 | | 参数 | 说明 | 类型 | 默认值 | 可选值 |
|-----------|-----------|-----------|-------------|-------------| |-----------|-----------|-----------|-------------|-------------|
| type | 组件类型 | `String` | `datetime` | `date` `time` `year-month` | | type | 组件类型 | `String` | `datetime` | `date` `time` <br> `year-month` |
| min-date | 可选的最小日期 | `Date` | 十年前的 1 月 1 日 | - | | min-date | 可选的最小日期 | `Date` | 十年前的 1 月 1 日 | - |
| max-date | 可选的最大日期 | `Date` | 十年后的 12 月 31 日 | - | | max-date | 可选的最大日期 | `Date` | 十年后的 12 月 31 日 | - |
| min-hour | 可选的最小小时 | `Number` | `0` | - | | min-hour | 可选的最小小时,针对 time 类型 | `Number` | `0` | - |
| max-hour | 可选的最大小时 | `Number` | `23` | - | | max-hour | 可选的最大小时,针对 time 类型 | `Number` | `23` | - |
| visible-item-count | 每一列可见备选元素的个数 | `Number` | `5` | - | | visible-item-count | 每一列可见备选元素的个数 | `Number` | `5` | - |
### Event ### Event

View File

@ -257,7 +257,6 @@ export default create({
}, },
updateColumnValue(value) { updateColumnValue(value) {
console.log(value, this.type);
let values = []; let values = [];
if (this.type === 'time') { if (this.type === 'time') {
const currentValue = value.split(':'); const currentValue = value.split(':');