Commit 7053de4e78bb0cbf6371ec0969c4523b91f5e92b

Authored by 梁灏
1 parent c61015d1

update demo

Showing 1 changed file with 5 additions and 2 deletions   Show diff stats
examples/routers/date.vue
1 <template> 1 <template>
2 <div> 2 <div>
3 {{ value1 }} 3 {{ value1 }}
4 - <Date-picker v-model="value1" :editable="false" type="datetimerange" placeholder="选择日期" style="width: 200px"></Date-picker> 4 + <Date-picker v-model="value1" type="datetimerange" placeholder="选择日期" style="width: 200px" @on-change="hc"></Date-picker>
5 <Button @click="setDate">set date</Button> 5 <Button @click="setDate">set date</Button>
6 <Button @click="getDate">get date</Button> 6 <Button @click="getDate">get date</Button>
7 <!--<Date-picker v-model="value2" type="daterange" placeholder="选择日期" style="width: 200px"></Date-picker>--> 7 <!--<Date-picker v-model="value2" type="daterange" placeholder="选择日期" style="width: 200px"></Date-picker>-->
@@ -12,7 +12,7 @@ @@ -12,7 +12,7 @@
12 export default { 12 export default {
13 data () { 13 data () {
14 return { 14 return {
15 - value1: ['2017-10-10', '2017-10-20'], 15 + value1: ['2014-10-10 10:00:01', '2017-10-10 10:00:00'],
16 value2: [] 16 value2: []
17 } 17 }
18 }, 18 },
@@ -26,6 +26,9 @@ @@ -26,6 +26,9 @@
26 getDate () { 26 getDate () {
27 const date = new Date(this.value1); 27 const date = new Date(this.value1);
28 console.log(date.getMonth()+1) 28 console.log(date.getMonth()+1)
  29 + },
  30 + hc (d) {
  31 + console.log(d);
29 } 32 }
30 } 33 }
31 } 34 }