1. <script setup lang="ts">
    2. import { computed, withDefaults } from 'vue';
    3. interface Props {
    4. prefix?: string;
    5. name?: string;
    6. color?: string;
    7. }
    8. const props = withDefaults(defineProps<Props>(), {
    9. prefix: 'icon',
    10. name: '',
    11. color: '#000',
    12. });
    13. const symbolId = computed(() => `#${props.prefix}-${props.name}`);
    14. </script>
    15. <template>
    16. <svg aria-hidden="true">
    17. <use :xlink:href="symbolId" :fill="color" />
    18. </svg>
    19. </template>