Commit b9a4026ff748916336635456d6693bfa00ae34b9

Authored by 梁灏
1 parent 4e23e47c

fixed #845

examples/routers/date.vue
1 <template> 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 </template> 3 </template>
10 <script> 4 <script>
11 export default { 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 </script> 8 </script>
30 9
31 10
  11 +
32 <!--<template>--> 12 <!--<template>-->
33 <!--<row>--> 13 <!--<row>-->
34 <!--<i-col span="12">--> 14 <!--<i-col span="12">-->
src/components/date-picker/panel/date-range.vue
@@ -324,7 +324,7 @@ @@ -324,7 +324,7 @@
324 if (this[`${direction}CurrentView`] === 'year') { 324 if (this[`${direction}CurrentView`] === 'year') {
325 this.$refs[`${direction}YearTable`].nextTenYear(); 325 this.$refs[`${direction}YearTable`].nextTenYear();
326 } else if (this[`${direction}CurrentView`] === 'month') { 326 } else if (this[`${direction}CurrentView`] === 'month') {
327 - this[`${direction}TableYear`]--; 327 + this[`${direction}TableYear`]++;
328 } else { 328 } else {
329 const date = this.date; 329 const date = this.date;
330 date.setFullYear(date.getFullYear() + 1); 330 date.setFullYear(date.getFullYear() + 1);