2022-04-21 17:14:30 +08:00
|
|
|
<template>
|
|
|
|
<svg class="svg-icon" aria-hidden="true">
|
2022-04-21 18:37:52 +08:00
|
|
|
<use :href="symbolId" />
|
2022-04-21 17:14:30 +08:00
|
|
|
</svg>
|
|
|
|
</template>
|
|
|
|
|
|
|
|
<script lang="ts" setup>
|
2022-04-22 01:16:02 +08:00
|
|
|
import { computed } from "vue"
|
2022-04-21 17:14:30 +08:00
|
|
|
|
|
|
|
const props = defineProps({
|
|
|
|
prefix: {
|
|
|
|
type: String,
|
2022-04-22 01:16:02 +08:00
|
|
|
default: "icon"
|
2022-04-21 17:14:30 +08:00
|
|
|
},
|
|
|
|
name: {
|
|
|
|
type: String,
|
|
|
|
required: true
|
|
|
|
}
|
|
|
|
})
|
|
|
|
|
|
|
|
const symbolId = computed(() => `#${props.prefix}-${props.name}`)
|
|
|
|
</script>
|
|
|
|
|
|
|
|
<style lang="scss" scoped>
|
|
|
|
.svg-icon {
|
|
|
|
width: 1em;
|
|
|
|
height: 1em;
|
|
|
|
fill: currentColor;
|
|
|
|
overflow: hidden;
|
|
|
|
}
|
|
|
|
</style>
|