Icon.vue 278 B

123456789101112131415
  1. <template>
  2. <component :is="src" />
  3. </template>
  4. <script setup lang="ts">
  5. import { computed } from "@nuxtjs/composition-api"
  6. const props = defineProps<{
  7. name: String
  8. }>()
  9. const src = computed(() => {
  10. return require(`~/assets/icons/${props.name}.svg?inline`)
  11. })
  12. </script>