Blame view

test/routers/date.vue 1.54 KB
0f677893   梁灏   update DatePicker
1
2
  <template>
      <div style="margin: 50px">
c46f385a   梁灏   update DatePicker
3
4
5
          <br>
          <row>
              <i-col span="4">
e1874103   梁灏   update DatePicker
6
7
8
9
10
11
12
13
                  <date-picker
                          style="width:200px"
                          placeholder="请选择日期"
                          :value.sync="value"
                          :options="options"
                          @on-change="change"
                          :format="format"
                          @on-open-change="change2"></date-picker>
c46f385a   梁灏   update DatePicker
14
15
16
17
18
19
20
21
              </i-col>
              <i-col span="4">
                  <date-picker type="year" style="width:200px" placeholder="请选择日期" :value.sync="value" :options="options"></date-picker>
              </i-col>
              <i-col span="4">
                  <date-picker type="month" style="width:200px" placeholder="请选择日期" :value.sync="value" :options="options"></date-picker>
              </i-col>
          </row>
0f677893   梁灏   update DatePicker
22
23
24
25
      </div>
  </template>
  <script>
      export default {
0f677893   梁灏   update DatePicker
26
          data () {
50637863   梁灏   update DatePicker
27
              return {
c46f385a   梁灏   update DatePicker
28
                  value: new Date(),
50637863   梁灏   update DatePicker
29
30
31
32
33
34
  //                value: '',
                  options: {
                      disabledDate(time) {
                          return time.getTime() < Date.now() - 8.64e7;
  //                        return time && time.valueOf() < Date.now();
                      }
c46f385a   梁灏   update DatePicker
35
                  },
344131a7   梁灏   update DatePicker
36
                  format: 'yyyy年MM月dd日'
50637863   梁灏   update DatePicker
37
              }
0f677893   梁灏   update DatePicker
38
39
          },
          computed: {},
c46f385a   梁灏   update DatePicker
40
41
          methods: {
              change (date) {
344131a7   梁灏   update DatePicker
42
                  console.log(date)
c46f385a   梁灏   update DatePicker
43
44
45
46
47
              },
              change2 (s) {
  //                console.log(s)
              }
          }
0f677893   梁灏   update DatePicker
48
49
      }
  </script>