Ckedotir BO performance upgrade
This commit is contained in:
parent
4593185759
commit
081a06b68c
1 changed files with 11 additions and 3 deletions
|
|
@ -292,15 +292,23 @@ export default defineComponent({
|
|||
})
|
||||
// @ts-ignore
|
||||
.then((editor: ClassicEditor) => {
|
||||
let timer = null as number|null;
|
||||
const updateContent = () => {
|
||||
const data = editor.getData();
|
||||
self.internalText = data;
|
||||
self.$emit("input", data);
|
||||
timer = null;
|
||||
};
|
||||
// Display all toolbar elements
|
||||
// console.log(Array.from(editor.ui.componentFactory.names()));
|
||||
self.editor = editor;
|
||||
editor.setData(this.internalText);
|
||||
editor.model.document.on("change:data", () => {
|
||||
if(timer) {
|
||||
clearTimeout(timer);
|
||||
}
|
||||
// * Keep track of internal editor
|
||||
let data = editor.getData();
|
||||
self.internalText = data;
|
||||
self.$emit("input", data);
|
||||
timer = setTimeout(updateContent, 1000) as never as number;
|
||||
});
|
||||
})
|
||||
// @ts-ignore
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue