Commit a931c8a3a29e89606f8814585dc5b20b7d24f24c

Authored by xingyu4j
1 parent 392b46c3

feat: notice editor readonly

yudao-ui-admin-vue3/src/components/Editor/src/Editor.vue
@@ -23,6 +23,7 @@ const props = defineProps({ @@ -23,6 +23,7 @@ const props = defineProps({
23 type: Object as PropType<IEditorConfig>, 23 type: Object as PropType<IEditorConfig>,
24 default: () => undefined 24 default: () => undefined
25 }, 25 },
  26 + readonly: propTypes.bool.def(false),
26 modelValue: propTypes.string.def('') 27 modelValue: propTypes.string.def('')
27 }) 28 })
28 29
@@ -61,7 +62,7 @@ const editorConfig = computed((): IEditorConfig =&gt; { @@ -61,7 +62,7 @@ const editorConfig = computed((): IEditorConfig =&gt; {
61 return Object.assign( 62 return Object.assign(
62 { 63 {
63 placeholder: '请输入内容...', 64 placeholder: '请输入内容...',
64 - readOnly: false, 65 + readOnly: props.readonly,
65 customAlert: (s: string, t: string) => { 66 customAlert: (s: string, t: string) => {
66 switch (t) { 67 switch (t) {
67 case 'success': 68 case 'success':
yudao-ui-admin-vue3/src/views/system/notice/index.vue
@@ -53,7 +53,7 @@ @@ -53,7 +53,7 @@
53 :data="detailData" 53 :data="detailData"
54 > 54 >
55 <template #content="{ row }"> 55 <template #content="{ row }">
56 - <Editor :model-value="row.content" read-only="true" /> 56 + <Editor :model-value="row.content" :readonly="true" />
57 </template> 57 </template>
58 </Descriptions> 58 </Descriptions>
59 <template #footer> 59 <template #footer>