wupengfei
2025-02-20 d924a0e3ad6d0d9905e5c198d64dc3339f3bc549
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
<template>
  <ProFieldCustom>
    <RichEdit v-model="innerModelValue" :maxlength="maxlength"></RichEdit>
    <template #readContent>
      <RichContent :content="innerModelValue" />
    </template>
  </ProFieldCustom>
</template>
 
<script setup lang="ts">
import { ProFieldCustom } from '@bole-core/components';
import RichEdit from './RichEdit.vue';
import RichContent from './RichContent.vue';
 
defineOptions({
  name: 'FormRichEdit',
});
 
type Props = {
  modelValue?: API.IntroInfo[];
  maxlength?: number;
};
 
const props = withDefaults(defineProps<Props>(), {
  modelValue: () => [] as API.IntroInfo[],
});
 
const emit = defineEmits<{
  (e: 'update:modelValue', modelValue: API.IntroInfo[]): void;
}>();
 
const innerModelValue = computed({
  get() {
    return props.modelValue;
  },
  set(val) {
    emit('update:modelValue', val);
  },
});
</script>