Blame view

src/components/icon/icon.vue 734 Bytes
7fa943eb   梁灏   init
1
2
3
4
5
6
7
  <template>
      <i :class="classes" :style="styles"></i>
  </template>
  <script>
      const prefixCls = 'ivu-icon';
  
      export default {
06322514   梁灏   support Radio
8
          name: 'Icon',
7fa943eb   梁灏   init
9
10
          props: {
              type: String,
b79b53ea   梁灏   Icon add color prop
11
12
              size: [Number, String],
              color: String
7fa943eb   梁灏   init
13
14
15
          },
          computed: {
              classes () {
b0893113   jingsam   :art: add eslint
16
                  return `${prefixCls} ${prefixCls}-${this.type}`;
7fa943eb   梁灏   init
17
18
              },
              styles () {
b79b53ea   梁灏   Icon add color prop
19
20
                  let style = {};
  
b0893113   jingsam   :art: add eslint
21
                  if (this.size) {
b79b53ea   梁灏   Icon add color prop
22
23
24
                      style['font-size'] = `${this.size}px`;
                  }
  
b0893113   jingsam   :art: add eslint
25
                  if (this.color) {
b79b53ea   梁灏   Icon add color prop
26
                      style.color = this.color;
7fa943eb   梁灏   init
27
                  }
b79b53ea   梁灏   Icon add color prop
28
29
  
                  return style;
7fa943eb   梁灏   init
30
31
              }
          }
b0893113   jingsam   :art: add eslint
32
33
      };
  </script>