Commit ba1422cd62d9a4def1c9a0f2b532b0633c3d7382
1 parent
f672ae02
update zh-TW
Showing
2 changed files
with
14 additions
and
5 deletions
Show diff stats
examples/routers/date.vue
1 | 1 | <template> |
2 | 2 | <div> |
3 | - {{ value1 }}-{{ value2 }} | |
3 | + {{ value1 }} | |
4 | 4 | <Date-picker v-model="value1" placeholder="选择日期" style="width: 200px"></Date-picker> |
5 | - <Date-picker v-model="value2" type="daterange" placeholder="选择日期" style="width: 200px"></Date-picker> | |
6 | - <Date-picker transfer type="datetimerange" placeholder="选择日期" style="width: 200px" @on-change="changeDate"></Date-picker> | |
5 | + <Button @click="setDate">set date</Button> | |
6 | + <Button @click="getDate">get date</Button> | |
7 | + <!--<Date-picker v-model="value2" type="daterange" placeholder="选择日期" style="width: 200px"></Date-picker>--> | |
8 | + <!--<Date-picker transfer type="datetimerange" placeholder="选择日期" style="width: 200px" @on-change="changeDate"></Date-picker>--> | |
7 | 9 | </div> |
8 | 10 | </template> |
9 | 11 | <script> |
10 | 12 | export default { |
11 | 13 | data () { |
12 | 14 | return { |
13 | - value1: '', | |
15 | + value1: '2017-10-23', | |
14 | 16 | value2: [] |
15 | 17 | } |
16 | 18 | }, |
17 | 19 | methods: { |
18 | 20 | changeDate(date){ |
19 | 21 | console.log(date); |
22 | + }, | |
23 | + setDate () { | |
24 | + this.value1 = '2017-09-20'; | |
25 | + }, | |
26 | + getDate () { | |
27 | + const date = new Date(this.value1); | |
28 | + console.log(date.getMonth()+1) | |
20 | 29 | } |
21 | 30 | } |
22 | 31 | } | ... | ... |
src/locale/lang/zh-TW.js