zhengyiming
2025-02-10 958b79ed89b9e742540f714a80261d222c0fc09b
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
35
36
37
38
39
40
41
42
<template>
  <Editor
    class="rich-editor-simple"
    style="overflow-y: hidden"
    :modelValue="content"
    mode="simple"
    :defaultConfig="editorConfig"
  />
</template>
 
<script setup lang="ts">
import '@wangeditor-next/editor/dist/css/style.css';
import { Editor } from '@wangeditor-next/editor-for-vue';
import { IEditorConfig } from '@wangeditor-next/editor';
 
defineOptions({
  name: 'RichEditorContent',
});
 
type Props = {
  content: string;
};
 
const props = withDefaults(defineProps<Props>(), {});
 
const editorConfig: Partial<IEditorConfig> = {
  autoFocus: false,
  readOnly: true,
};
</script>
 
<style lang="scss" scoped>
@use '@/style/common.scss' as *;
 
.rich-editor-simple {
  :deep() {
    [data-slate-editor] {
      padding: 0;
    }
  }
}
</style>