Skip to content

Commit

Permalink
richEditor readonly
Browse files Browse the repository at this point in the history
  • Loading branch information
wulff007 committed Jun 28, 2024
1 parent 941f3d5 commit 862a2f7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/components/RichTextEditor.vue
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<template>
<div v-if="editor" style="width: 100%; height: fit-content" >

<div class="editor-panel">
<div class="editor-panel" v-if="!readonly">
<el-button class="editor-panel-button" size="small" text @click="editor.chain().focus().toggleBold().run()">
<Icon class="editor-panel-button-icon" icon="material-symbols:format-bold" width="18" />
</el-button>
Expand Down Expand Up @@ -145,7 +145,6 @@ async function getValue() {
}
function init() {
console.log(props)
editor.value = new Editor({
extensions: [
StarterKit,
Expand All @@ -158,7 +157,7 @@ function init() {
onUpdate: () => {
change(editor.value.getHTML())
},
editable: !props.disabled
editable: !props.disabled && !props.readonly
})
}
Expand Down

0 comments on commit 862a2f7

Please sign in to comment.