Commit 7053de4e78bb0cbf6371ec0969c4523b91f5e92b
1 parent
c61015d1
update demo
Showing
1 changed file
with
5 additions
and
2 deletions
Show diff stats
examples/routers/date.vue
1 | 1 | <template> |
2 | 2 | <div> |
3 | 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 | 5 | <Button @click="setDate">set date</Button> |
6 | 6 | <Button @click="getDate">get date</Button> |
7 | 7 | <!--<Date-picker v-model="value2" type="daterange" placeholder="选择日期" style="width: 200px"></Date-picker>--> |
... | ... | @@ -12,7 +12,7 @@ |
12 | 12 | export default { |
13 | 13 | data () { |
14 | 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 | 16 | value2: [] |
17 | 17 | } |
18 | 18 | }, |
... | ... | @@ -26,6 +26,9 @@ |
26 | 26 | getDate () { |
27 | 27 | const date = new Date(this.value1); |
28 | 28 | console.log(date.getMonth()+1) |
29 | + }, | |
30 | + hc (d) { | |
31 | + console.log(d); | |
29 | 32 | } |
30 | 33 | } |
31 | 34 | } | ... | ... |