Blame view

test/routers/date.vue 3.31 KB
0f677893   梁灏   update DatePicker
1
  <template>
d31b0801   梁灏   fixed DatePicker bug
2
      <row>
36931442   梁灏   update DateTimePi...
3
          <i-col span="12">
49bef31b   梁灏   release 0.9.12
4
              <Date-picker type="datetime" :options="options1" placeholder="选择日期" style="width: 200px"></Date-picker>
36931442   梁灏   update DateTimePi...
5
          </i-col>
456877a1   梁灏   update TimePicker
6
          <i-col span="12">
49bef31b   梁灏   release 0.9.12
7
              <Date-picker type="datetimerange" :options="options2" placement="bottom-end" placeholder="选择日期" style="width: 200px"></Date-picker>
9d844d53   梁灏   fixed Layout bug
8
          </i-col>
d31b0801   梁灏   fixed DatePicker bug
9
      </row>
0f677893   梁灏   update DatePicker
10
11
12
  </template>
  <script>
      export default {
2d948738   梁灏   update TimePicker...
13
14
          data () {
              return {
49bef31b   梁灏   release 0.9.12
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
                  options1: {
                      shortcuts: [
                          {
                              text: '今天',
                              value () {
                                  return new Date();
                              },
                              onClick: (picker) => {
                                  this.$Message.info('点击了今天');
                              }
                          },
                          {
                              text: '昨天',
                              value () {
                                  const date = new Date();
                                  date.setTime(date.getTime() - 3600 * 1000 * 24);
                                  return date;
                              },
                              onClick: (picker) => {
                                  this.$Message.info('点击了昨天');
                              }
                          },
                          {
                              text: '一周前',
                              value () {
                                  const date = new Date();
                                  date.setTime(date.getTime() - 3600 * 1000 * 24 * 7);
                                  return date;
                              },
                              onClick: (picker) => {
                                  this.$Message.info('点击了一周前');
                              }
                          }
                      ]
                  },
                  options2: {
                      shortcuts: [
                          {
                              text: '最近一周',
                              value () {
                                  const end = new Date();
                                  const start = new Date();
                                  start.setTime(start.getTime() - 3600 * 1000 * 24 * 7);
                                  return [start, end];
                              }
                          },
                          {
                              text: '最近一个月',
                              value () {
                                  const end = new Date();
                                  const start = new Date();
                                  start.setTime(start.getTime() - 3600 * 1000 * 24 * 30);
                                  return [start, end];
                              }
                          },
                          {
                              text: '最近三个月',
                              value () {
                                  const end = new Date();
                                  const start = new Date();
                                  start.setTime(start.getTime() - 3600 * 1000 * 24 * 90);
                                  return [start, end];
                              }
                          }
                      ]
                  }
2d948738   梁灏   update TimePicker...
81
82
              }
          }
0f677893   梁灏   update DatePicker
83
      }
d20fe0ee   梁灏   update DatePicker
84
  </script>