Blame view

src/components/date-picker/picker/time-picker.js 1.31 KB
9d844d53   梁灏   fixed Layout bug
1
  import Picker from '../picker.vue';
95eae081   Sergio Crisostomo   refactor Datepicker
2
3
  import TimePickerPanel from '../panel/Time/time.vue';
  import RangeTimePickerPanel from '../panel/Time/time-range.vue';
c1abaed9   梁灏   update TimePicker
4
  import Options from '../time-mixins';
9d844d53   梁灏   fixed Layout bug
5
  
75cb2998   Sergio Crisostomo   Add keyboard navi...
6
  import { findComponentsDownward, oneOf } from '../../../utils/assist';
456877a1   梁灏   update TimePicker
7
  
9d844d53   梁灏   fixed Layout bug
8
  export default {
c1abaed9   梁灏   update TimePicker
9
      mixins: [Picker, Options],
95eae081   Sergio Crisostomo   refactor Datepicker
10
      components: { TimePickerPanel, RangeTimePickerPanel },
9d844d53   梁灏   fixed Layout bug
11
      props: {
456877a1   梁灏   update TimePicker
12
13
14
15
16
17
          type: {
              validator (value) {
                  return oneOf(value, ['time', 'timerange']);
              },
              default: 'time'
          },
9d844d53   梁灏   fixed Layout bug
18
      },
95eae081   Sergio Crisostomo   refactor Datepicker
19
20
21
22
23
24
25
      computed: {
          panel(){
              const isRange =  this.type === 'timerange';
              return isRange ? 'RangeTimePickerPanel' : 'TimePickerPanel';
          },
          ownPickerProps(){
              return {
732b32e4   Sergio Crisostomo   correct wrong spr...
26
27
28
29
                  disabledHours: this.disabledHours,
                  disabledMinutes: this.disabledMinutes,
                  disabledSeconds: this.disabledSeconds,
                  hideDisabledOptions: this.hideDisabledOptions
95eae081   Sergio Crisostomo   refactor Datepicker
30
              };
456877a1   梁灏   update TimePicker
31
          }
95eae081   Sergio Crisostomo   refactor Datepicker
32
      },
75cb2998   Sergio Crisostomo   Add keyboard navi...
33
34
35
36
37
38
39
40
41
42
      watch: {
          visible(visible){
              if (visible) {
                  this.$nextTick(() => {
                      const spinners = findComponentsDownward(this, 'TimeSpinner');
                      spinners.forEach(instance => instance.updateScroll());
                  });
              }
          }
      }
9b376832   Sergio Crisostomo   Add feature: allo...
43
  };