<template>
  <div class="object-cover" @click="clickSelf">
    <div v-show="type === 'png'">
      <img src="@/assets/icons/shiba.png" class="object-cover object-center" />
    </div>
    <svg
      v-show="type === 'svg'"
      aria-hidden="true"
      :height="size"
      :width="size"
      :fill="color"
    >
      <use :xlink:href="'#' + name"></use>
    </svg>
  </div>
</template>

<script lang="ts">
import { defineComponent } from "vue";

export default defineComponent({
  emits: ["click"],
  props: {
    type: {
      type: String,
      default: "svg",
    },
    size: {
      type: String,
      default: "14px",
    },
    color: {
      type: String,
      default: "#ffffff",
    },
    name: {
      type: String,
      default: "icon-anquanzhongxin89",
    },
  },
  methods: {
    clickSelf() {
      this.$emit("click");
    },
  },
});
</script>

