feat(@vben/plugins): add tiptap rich text editor
This commit is contained in:
33
packages/effects/plugins/src/tiptap/preview.vue
Normal file
33
packages/effects/plugins/src/tiptap/preview.vue
Normal file
@@ -0,0 +1,33 @@
|
||||
<script setup lang="ts">
|
||||
import type { TipTapPreviewProps } from './types';
|
||||
|
||||
import { computed } from 'vue';
|
||||
|
||||
import { cn } from '@vben-core/shared/utils';
|
||||
|
||||
import './style.css';
|
||||
const props = withDefaults(defineProps<TipTapPreviewProps>(), {
|
||||
content: '',
|
||||
minHeight: 160,
|
||||
});
|
||||
const contentMinHeight = computed(() =>
|
||||
typeof props.minHeight === 'number'
|
||||
? `${props.minHeight}px`
|
||||
: props.minHeight,
|
||||
);
|
||||
const previewClass = computed(() =>
|
||||
cn(
|
||||
'vben-tiptap-content bg-transparent p-0 leading-7 text-foreground',
|
||||
props.class,
|
||||
),
|
||||
);
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<!-- eslint-disable vue/no-v-html -->
|
||||
<div
|
||||
:class="previewClass"
|
||||
:style="{ minHeight: contentMinHeight }"
|
||||
v-html="content"
|
||||
></div>
|
||||
</template>
|
||||
Reference in New Issue
Block a user