bug fixed
This commit is contained in:
@ -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,
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user