Blame view

src/components/cascader/casitem.vue 2.34 KB
c463ab87   梁灏   add Cascader
1
  <template>
f7ffdac5   梁灏   Cascader support ...
2
3
      <li :class="classes">
          {{ data.label }}
47afd12e   梁灏   Cascader add gloa...
4
          <Icon :type="arrowType" :custom="customArrowType" :size="arrowSize" v-if="showArrow" />
929fdf5c   梁灏   update loading icon
5
          <i v-if="showLoading" class="ivu-icon ivu-icon-ios-loading ivu-load-loop"></i>
f7ffdac5   梁灏   Cascader support ...
6
      </li>
c463ab87   梁灏   add Cascader
7
8
  </template>
  <script>
47afd12e   梁灏   Cascader add gloa...
9
10
      import Icon from '../icon/icon.vue';
  
c463ab87   梁灏   add Cascader
11
      export default {
47a7f21d   梁灏   support Cascader
12
          name: 'Casitem',
47afd12e   梁灏   Cascader add gloa...
13
          components: { Icon },
c463ab87   梁灏   add Cascader
14
15
16
17
18
19
20
21
22
23
          props: {
              data: Object,
              prefixCls: String,
              tmpItem: Object
          },
          computed: {
              classes () {
                  return [
                      `${this.prefixCls}-menu-item`,
                      {
bd4e3b9b   梁灏   update Cascader
24
25
                          [`${this.prefixCls}-menu-item-active`]: this.tmpItem.value === this.data.value,
                          [`${this.prefixCls}-menu-item-disabled`]: this.data.disabled
c463ab87   梁灏   add Cascader
26
                      }
b0893113   jingsam   :art: add eslint
27
                  ];
f7ffdac5   梁灏   Cascader support ...
28
29
30
31
32
33
              },
              showArrow () {
                  return (this.data.children && this.data.children.length) || ('loading' in this.data && !this.data.loading);
              },
              showLoading () {
                  return 'loading' in this.data && this.data.loading;
47afd12e   梁灏   Cascader add gloa...
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
              },
              // 3.4.0, global setting customArrow 有值时,arrow 赋值空
              arrowType () {
                  let type = 'ios-arrow-forward';
  
                  if (this.$IVIEW) {
                      if (this.$IVIEW.cascader.customItemArrow) {
                          type = '';
                      } else if (this.$IVIEW.cascader.itemArrow) {
                          type = this.$IVIEW.cascader.itemArrow;
                      }
                  }
                  return type;
              },
              // 3.4.0, global setting
              customArrowType () {
                  let type = '';
  
                  if (this.$IVIEW) {
                      if (this.$IVIEW.cascader.customItemArrow) {
                          type = this.$IVIEW.cascader.customItemArrow;
                      }
                  }
                  return type;
              },
              // 3.4.0, global setting
              arrowSize () {
                  let size = '';
  
                  if (this.$IVIEW) {
                      if (this.$IVIEW.cascader.itemArrowSize) {
                          size = this.$IVIEW.cascader.itemArrowSize;
                      }
                  }
                  return size;
c463ab87   梁灏   add Cascader
69
              }
c463ab87   梁灏   add Cascader
70
          }
b0893113   jingsam   :art: add eslint
71
72
      };
  </script>