|
@@ -7,7 +7,7 @@ import { FontColor, FontFamily, FontSize } from "@ckeditor/ckeditor5-font";
|
|
|
import { Link } from "@ckeditor/ckeditor5-link";
|
|
|
import { Paragraph } from "@ckeditor/ckeditor5-paragraph";
|
|
|
import { css } from "@linaria/core";
|
|
|
-import { defineComponent, ref, watch, watchEffect } from "vue";
|
|
|
+import { defineComponent, ref, watch, watchEffect, reactive } from "vue";
|
|
|
import { string } from "vue-types";
|
|
|
import { useCompData } from ".";
|
|
|
import { View } from "../View";
|
|
@@ -54,10 +54,12 @@ export const Component = defineComponent({
|
|
|
|
|
|
let editorInstance: InlineEditor;
|
|
|
let timeOut = ref();
|
|
|
+ const state = reactive({
|
|
|
+ textEditing: false,
|
|
|
+ });
|
|
|
|
|
|
watchEffect(() => {
|
|
|
- console.log("1111", store.textEditingState);
|
|
|
- if (!store.textEditingState) {
|
|
|
+ if (!state.textEditing) {
|
|
|
editorInstance?.setData(comp.value);
|
|
|
}
|
|
|
});
|
|
@@ -79,21 +81,15 @@ export const Component = defineComponent({
|
|
|
class={textStyle}
|
|
|
editor={InlineEditor}
|
|
|
onBlur={() => {
|
|
|
- // actions.updateCompData(
|
|
|
- // helper.findComp(props.compId) as DesignComp,
|
|
|
- // "value",
|
|
|
- // editorInstance.getData()
|
|
|
- // );
|
|
|
- // store.setTextEditingState(false);
|
|
|
-
|
|
|
- // console.log("blur", editorInstance);
|
|
|
timeOut.value = setTimeout(() => {
|
|
|
+ state.textEditing = false;
|
|
|
store.setTextEditingState(false);
|
|
|
controls.historyCtrl.history.submit();
|
|
|
}, 500);
|
|
|
}}
|
|
|
onFocus={() => {
|
|
|
store.setTextEditingState(true);
|
|
|
+ state.textEditing = true;
|
|
|
}}
|
|
|
onInput={(e: any) => {
|
|
|
if (editorInstance) {
|