vp-semantic.vue 418 B

1234567891011121314151617
  1. <script setup lang="ts">
  2. import { computed, defineAsyncComponent } from 'vue'
  3. const { component } = defineProps<{
  4. component: string
  5. }>()
  6. const normalizedComponent = computed(() => component.slice(0, 1).toLowerCase() + component.slice(1))
  7. const SemanticComponent = defineAsyncComponent(() => import(`../../../semantics/${normalizedComponent.value}.vue`))
  8. </script>
  9. <template>
  10. <SemanticComponent />
  11. </template>