feat: notice editor readonly

pull/2/head
xingyu4j 2022-12-15 10:52:31 +08:00
parent 392b46c370
commit a931c8a3a2
2 changed files with 3 additions and 2 deletions

View File

@ -23,6 +23,7 @@ const props = defineProps({
type: Object as PropType<IEditorConfig>, type: Object as PropType<IEditorConfig>,
default: () => undefined default: () => undefined
}, },
readonly: propTypes.bool.def(false),
modelValue: propTypes.string.def('') modelValue: propTypes.string.def('')
}) })
@ -61,7 +62,7 @@ const editorConfig = computed((): IEditorConfig => {
return Object.assign( return Object.assign(
{ {
placeholder: '请输入内容...', placeholder: '请输入内容...',
readOnly: false, readOnly: props.readonly,
customAlert: (s: string, t: string) => { customAlert: (s: string, t: string) => {
switch (t) { switch (t) {
case 'success': case 'success':

View File

@ -53,7 +53,7 @@
:data="detailData" :data="detailData"
> >
<template #content="{ row }"> <template #content="{ row }">
<Editor :model-value="row.content" read-only="true" /> <Editor :model-value="row.content" :readonly="true" />
</template> </template>
</Descriptions> </Descriptions>
<template #footer> <template #footer>