AIzhushou-screen/src/components/QSvg/index.vue

30 lines
590 B
Vue
Raw Normal View History

2024-05-22 10:22:28 +08:00
<template>
<svg aria-hidden="true">
<use :xlink:href="symbolId" :fill="color" />
</svg>
</template>
<script setup name="QSvg" lang="ts">
const props = defineProps({
prefix: {
type: String,
default: 'icon',
},
name: {
type: String,
required: false,//页面刷新的时候,请求数据返回慢,会报一个类型错误
default: 'buy'
},
color: {
type: String,
default: '#333',
},
});
const symbolId = computed(() => `#${props.prefix}-${props.name}`);
defineExpose({
symbolId: symbolId,
});
</script>
<style lang="less" scoped></style>