feat(projects): 本地svg动态渲染图标

ISSUES CLOSED: #61
This commit is contained in:
Soybean
2022-06-16 01:17:31 +08:00
parent 833018a831
commit c3c975ee11
16 changed files with 1067 additions and 63 deletions

View File

@ -0,0 +1,24 @@
<template>
<svg aria-hidden="true" width="1em" height="1em" class="inline-block">
<use :xlink:href="symbolId" fill="currentColor" />
</svg>
</template>
<script setup lang="ts">
import { computed } from 'vue';
interface Props {
/** 前缀 */
prefix?: string;
/** 图标名称(图片的文件名) */
icon: string;
}
const props = withDefaults(defineProps<Props>(), {
prefix: 'icon-custom'
});
const symbolId = computed(() => `#${props.prefix}-${props.icon}`);
</script>
<style scoped></style>