Blame view

src/components/icon/icon.vue 622 Bytes
7fa943eb   梁灏   init
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
  <template>
      <i :class="classes" :style="styles"></i>
  </template>
  <script>
      const prefixCls = 'ivu-icon';
  
      export default {
          props: {
              type: String,
              size: [Number, String]
          },
          computed: {
              classes () {
                  return `${prefixCls} ${prefixCls}-${this.type}`
              },
              styles () {
                  if (!!this.size) {
                      return {
                          'font-size': `${this.size}px`
                      }
                  } else {
                      return {}
                  }
              }
          }
      }
  </script>