Add line breaks to description
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
<script setup lang="ts">
|
||||
withDefaults(
|
||||
defineProps<{
|
||||
tag?: string;
|
||||
text: string;
|
||||
css?: string;
|
||||
}>(),
|
||||
{
|
||||
tag: 'p',
|
||||
css: ''
|
||||
}
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<component
|
||||
:is="tag"
|
||||
v-for="(line, i) in text.split('\n')"
|
||||
:key="i"
|
||||
:class="css"
|
||||
>
|
||||
{{ line }}
|
||||
</component>
|
||||
</template>
|
||||
|
||||
<style scoped></style>
|
||||
Reference in New Issue
Block a user