Blame view

test/routers/date.vue 1.64 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
  //                value: '',
                  options: {
                      disabledDate(time) {
13be4434   梁灏   update DatePicker
32
33
  //                        console.log(time)
  //                        return time.getFullYear() < 2016;
50637863   梁灏   update DatePicker
34
35
36
                          return time.getTime() < Date.now() - 8.64e7;
  //                        return time && time.valueOf() < Date.now();
                      }
c46f385a   梁灏   update DatePicker
37
                  },
344131a7   梁灏   update DatePicker
38
                  format: 'yyyy年MM月dd日'
50637863   梁灏   update DatePicker
39
              }
0f677893   梁灏   update DatePicker
40
41
          },
          computed: {},
c46f385a   梁灏   update DatePicker
42
43
          methods: {
              change (date) {
344131a7   梁灏   update DatePicker
44
                  console.log(date)
c46f385a   梁灏   update DatePicker
45
46
47
48
49
              },
              change2 (s) {
  //                console.log(s)
              }
          }
0f677893   梁灏   update DatePicker
50
51
      }
  </script>