<template>
  <svg
    class="icon"
    aria-hidden="true"
    v-if="!isSvg"
    :style="`font-size:${size}`"
  >
    <use :xlink:href="`#icon-${type}`"></use>
  </svg>
  <!-- <span v-if="!isSvg" class="iconfont" :class="`icon-${type}`" style="fill:#ffffff"></span> -->
  <img :src="`/svg/${type}.svg`" v-else />
</template>

<script lang="ts" setup>
import "./iconfont";
const props = defineProps({
  type: String,
  isSvg: Boolean,
  size: String,
});
</script>

<style>
@import url("./iconfont.css");
.icon {
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  fill: currentColor;
  overflow: hidden;
}
</style>
