gaoluyang
2026-06-24 bfdc0e0e6d5e47aa501f9b6fadd143d9c97cf00a
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<script setup lang="ts">
import type { TipTapPreviewProps } from './types';
 
import { computed } from 'vue';
 
import { cn } from '../../../../@core/base/shared/src/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',
    'text-foreground bg-transparent p-0 leading-7',
    props.class,
  ),
);
</script>
 
<template>
  <!-- eslint-disable vue/no-v-html -->
  <div
    :class="previewClass"
    :style="{ minHeight: contentMinHeight }"
    v-html="content"
  ></div>
</template>