all files / src/components/ icon.vue

100% Statements 0/0
100% Branches 0/0
100% Functions 1/1
100% Lines 0/0
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 28 29 30 31 32 33 34                                                                   
<template>
  <svg :class="{icon: true, loading: iconName==='loading'}">
    <use :xlink:href="`#i-${iconName}`"></use>
  </svg>
</template>
 
<script>
export default {
  name: "icon",
  props: ["iconName"],
  created() {
    
  }
}
</script>
 
<style lang="scss" scoped>
.icon {
  height: 1em;
  width: 1em;
  &.loading {
    animation: spin 1s infinite linear;
  }
  @keyframes spin {
    0% {
      transform: rotate(0deg);
    }
    100% {
      transform: rotate(360deg);
    }
  }
}
</style>