wf4/app/components/RichText/General.vue
webfussel a204be8ddc REMOVE: (Urban) as SEO is okay again
Removed the (Urban) which was added after marriage for better SEO
2025-03-18 12:54:31 +01:00

40 lines
821 B
Vue
Executable file

<template>
<component :is="computedComponent.is" v-bind="computedComponent.props" />
</template>
<script setup lang="ts">
import type { RichText } from './Types'
type Props = {
element : RichText
}
const { element } = defineProps<Props>()
const computedComponent = computed(() => {
let is : ReturnType<typeof resolveComponent> = {}
switch (element.type) {
case 'plain':
is = resolveComponent('RichTextPlain')
break
case 'p':
is = resolveComponent('RichTextParagraph')
break
case 'span':
is = resolveComponent('RichTextString')
break
case 'a':
is = resolveComponent('RichTextLink')
break
case 'br':
is = resolveComponent('RichTextNewLine')
break
default:
break
}
return { is, props: { ...element } }
})
</script>