Blame view

src/components/date-picker/picker/date-picker.js 496 Bytes
17e1fcf1   梁灏   init DatePicker
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
  import Picker from '../picker.vue';
  import DatePanel from '../panel/date.vue';
  import DateRangePanel from '../panel/date-range.vue';
  
  const getPanel = function (type) {
      if (type === 'daterange' || type === 'datetimerange') {
          return DateRangePanel;
      }
      return DatePanel;
  };
  
  export default {
      mixins: [Picker],
      props: {
          type: {
              type: String,
              default: 'date'
          }
      },
      created() {
          this.panel = getPanel(this.type);
      }
  }