Blame view

src/components/date-picker/picker/date-picker.js 843 Bytes
17e1fcf1   梁灏   init DatePicker
1
  import Picker from '../picker.vue';
95eae081   Sergio Crisostomo   refactor Datepicker
2
3
  import DatePickerPanel from '../panel/Date/date.vue';
  import RangeDatePickerPanel from '../panel/Date/date-range.vue';
17e1fcf1   梁灏   init DatePicker
4
  
0f677893   梁灏   update DatePicker
5
6
  import { oneOf } from '../../../utils/assist';
  
17e1fcf1   梁灏   init DatePicker
7
  export default {
75cb2998   Sergio Crisostomo   Add keyboard navi...
8
      name: 'CalendarPicker',
17e1fcf1   梁灏   init DatePicker
9
10
11
      mixins: [Picker],
      props: {
          type: {
0f677893   梁灏   update DatePicker
12
              validator (value) {
e0cd7f90   梁灏   fixed #134
13
                  return oneOf(value, ['year', 'month', 'date', 'daterange', 'datetime', 'datetimerange']);
0f677893   梁灏   update DatePicker
14
              },
17e1fcf1   梁灏   init DatePicker
15
              default: 'date'
50637863   梁灏   update DatePicker
16
          },
17e1fcf1   梁灏   init DatePicker
17
      },
95eae081   Sergio Crisostomo   refactor Datepicker
18
19
20
21
22
23
24
      components: { DatePickerPanel, RangeDatePickerPanel },
      computed: {
          panel(){
              const isRange =  this.type === 'daterange' || this.type === 'datetimerange';
              return isRange ? 'RangeDatePickerPanel' : 'DatePickerPanel';
          },
          ownPickerProps(){
4863a75d   Sergio Crisostomo   Correct logic whe...
25
              return this.options;
9ffdd6da   Sergio Crisostomo   Propagate type ch...
26
27
          }
      },
b0893113   jingsam   :art: add eslint
28
  };