Blame view

src/components/date-picker/panel/mixin.js 952 Bytes
3cf7cfd1   梁灏   update DatePicker
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
  const prefixCls = 'ivu-picker-panel';
  const datePrefixCls = 'ivu-date-picker';
  
  export default {
      methods: {
          iconBtnCls (direction, type = '') {
              return [
                  `${prefixCls}-icon-btn`,
                  `${datePrefixCls}-${direction}-btn`,
                  `${datePrefixCls}-${direction}-btn-arrow${type}`,
              ]
          },
          handleShortcutClick (shortcut) {
              if (shortcut.value) this.$emit('on-pick', shortcut.value());
              if (shortcut.onClick) shortcut.onClick(this);
472b4ff1   梁灏   update DatePicker
16
17
18
19
20
21
22
23
24
25
26
27
          },
          resetView() {
              if (this.selectionMode === 'month') {
                  this.currentView = 'month';
              } else if (this.selectionMode === 'year') {
                  this.currentView = 'year';
              } else {
                  this.currentView = 'date';
              }
  
              this.year = this.date.getFullYear();
              this.month = this.date.getMonth();
3cf7cfd1   梁灏   update DatePicker
28
29
30
          }
      }
  }