feat(@vben/plugins): add tiptap rich text editor

This commit is contained in:
xingyu4j
2026-03-30 19:36:29 +08:00
committed by allen
parent 2930dcd78e
commit 5eca357a5c
20 changed files with 1861 additions and 4 deletions

View 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>