Blame view

src/components/date-picker/picker/date-picker.js 815 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
8
9
10
  export default {
      mixins: [Picker],
      props: {
          type: {
0f677893   梁灏   update DatePicker
11
              validator (value) {
e0cd7f90   梁灏   fixed #134
12
                  return oneOf(value, ['year', 'month', 'date', 'daterange', 'datetime', 'datetimerange']);
0f677893   梁灏   update DatePicker
13
              },
17e1fcf1   梁灏   init DatePicker
14
              default: 'date'
50637863   梁灏   update DatePicker
15
          },
17e1fcf1   梁灏   init DatePicker
16
      },
95eae081   Sergio Crisostomo   refactor Datepicker
17
18
19
20
21
22
23
      components: { DatePickerPanel, RangeDatePickerPanel },
      computed: {
          panel(){
              const isRange =  this.type === 'daterange' || this.type === 'datetimerange';
              return isRange ? 'RangeDatePickerPanel' : 'DatePickerPanel';
          },
          ownPickerProps(){
4863a75d   Sergio Crisostomo   Correct logic whe...
24
              return this.options;
9ffdd6da   Sergio Crisostomo   Propagate type ch...
25
26
          }
      },
b0893113   jingsam   :art: add eslint
27
  };