<!--
 * @Author: Jason Liu
 * @Date: 2021-03-22 10:58:05
 * @Desc: 
-->
<template>
  <svg :class="svgClass" aria-hidden="true">
    <use :xlink:href="iconName" />
  </svg>
</template>

<script>
export default {
  name: "svgIcon",
  props: {
    type: {
      type: String,
      required: true
    }
  },
  created() {
  },
  computed: {
    iconName() {
      return `#icon-${this.type}`;
    },
    svgClass() {
      if (this.class) {
        return "win-icon svg-icon" + this.class;
      } else {
        return "win-icon svg-icon";
      }
    }
  }
};
</script>

<style scoped>
.win-icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  fill: currentColor;
  overflow: hidden;
}
</style>
