Commit b9a4026ff748916336635456d6693bfa00ae34b9
1 parent
4e23e47c
fixed #845
Showing
2 changed files
with
3 additions
and
23 deletions
Show diff stats
examples/routers/date.vue
| 1 | 1 | <template> |
| 2 | - <div> | |
| 3 | - {{ val1 }} | |
| 4 | - <Date-picker type="datetime" placeholder="选择日期和时间" style="width: 200px"></Date-picker> | |
| 5 | - <Date-picker v-model="val1" type="date" placeholder="选择日期" style="width: 200px"></Date-picker> | |
| 6 | - <Date-picker type="daterange" placement="bottom-end" placeholder="选择日期" style="width: 200px"></Date-picker> | |
| 7 | - <div @click="val1 = '2017-03-02'">change</div> | |
| 8 | - </div> | |
| 2 | + <Date-picker type="daterange" placeholder="选择日期" style="width: 200px"></Date-picker> | |
| 9 | 3 | </template> |
| 10 | 4 | <script> |
| 11 | 5 | export default { |
| 12 | - data () { | |
| 13 | - return { | |
| 14 | - val1: '' | |
| 15 | - } | |
| 16 | - }, | |
| 17 | - computed: { | |
| 18 | - ddd () { | |
| 19 | - const date = new Date(this.val1); | |
| 20 | - const year = date.getFullYear(); | |
| 21 | - const month = date.getMonth() + 1; | |
| 22 | - const day = date.getDate(); | |
| 23 | 6 | |
| 24 | - return `${year}-${month}-${day}`; | |
| 25 | - | |
| 26 | - } | |
| 27 | - } | |
| 28 | 7 | } |
| 29 | 8 | </script> |
| 30 | 9 | |
| 31 | 10 | |
| 11 | + | |
| 32 | 12 | <!--<template>--> |
| 33 | 13 | <!--<row>--> |
| 34 | 14 | <!--<i-col span="12">--> | ... | ... |
src/components/date-picker/panel/date-range.vue
| ... | ... | @@ -324,7 +324,7 @@ |
| 324 | 324 | if (this[`${direction}CurrentView`] === 'year') { |
| 325 | 325 | this.$refs[`${direction}YearTable`].nextTenYear(); |
| 326 | 326 | } else if (this[`${direction}CurrentView`] === 'month') { |
| 327 | - this[`${direction}TableYear`]--; | |
| 327 | + this[`${direction}TableYear`]++; | |
| 328 | 328 | } else { |
| 329 | 329 | const date = this.date; |
| 330 | 330 | date.setFullYear(date.getFullYear() + 1); | ... | ... |