bug fixed

This commit is contained in:
cxc
2022-11-25 17:30:10 +08:00
parent 69d6c487ac
commit a7a8f21d11
33 changed files with 1700 additions and 558 deletions

View File

@ -18,6 +18,7 @@
:mode="mode"
@onCreated="handleCreated"
@onChange="handleChange"
@onBlur="emitBlur"
/>
</div>
</template>
@ -142,13 +143,16 @@ export default {
};
const handleChange = (editor) => {
if (editor.getHtml() === "<p><br></p>") {
if (editor.isEmpty()) {
context.emit("update:modelValue", "");
} else {
context.emit("update:modelValue", editor.getHtml());
}
};
const emitBlur = () => {
context.emit("blur", editorRef.value);
// editorRef.value.emit("blur");
};
return {
editorRef,
valueHtml,
@ -158,6 +162,7 @@ export default {
height,
handleCreated,
handleChange,
emitBlur,
};
},
};