Blame view

src/components/date-picker/picker/time-picker.js 1009 Bytes
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
  
456877a1   梁灏   update TimePicker
6
7
  import { oneOf } from '../../../utils/assist';
  
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
      },
9b376832   Sergio Crisostomo   Add feature: allo...
33
  };