<template>
    <svg class="icon" aria-hidden="true" @click="emit('click')">
        <use :xlink:href="`#${props.type}`"></use>
    </svg>
</template>

<script lang="ts" setup>
import { IconTypes } from "@types/index"
interface Props{
    type:IconTypes
}
const emit = defineEmits(["click"])
const props = defineProps<Props>()
</script>

<style lang="less" scoped>
i {
    margin-right: 4px;
    vertical-align: middle;
}

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