dragon-editor 3.5.18 → 3.5.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/module.json CHANGED
@@ -4,7 +4,7 @@
4
4
  "nuxt": ">=3.0.0"
5
5
  },
6
6
  "configKey": "dragon-editor",
7
- "version": "3.5.18",
7
+ "version": "3.5.19",
8
8
  "builder": {
9
9
  "@nuxt/module-builder": "0.8.4",
10
10
  "unbuild": "2.0.0"
@@ -1,9 +1,9 @@
1
1
  <template>
2
- <component :is="mainStrucutre()"></component>
2
+ <component :is="editorStructure"></component>
3
3
  </template>
4
4
 
5
5
  <script setup lang="ts">
6
- import { ref, h, onMounted, onBeforeUnmount } from "vue";
6
+ import { ref, h, onMounted, onBeforeUnmount, watch } from "vue";
7
7
  import { _getBodyVNodeStructure, _getMenuBarVNodeStructure, _getControlbarVNodeStructure } from "../utils/layout";
8
8
  import { _eidtorMountEvent, _eidtorUnmountEvent, _editorMousemoveEvent, _editorMouseupEvent, _editorMouseleaveEvent, _editorTouchmoveEvent, _editorTouchendEvent, _checkOthersideClick, _parentWrapScollEvent, _editorContextMenuEvent, _windowResizeEvent } from "../utils/event";
9
9
  import { _addBlock } from "../utils/node";
@@ -127,6 +127,7 @@ const editorStore = ref<DragonEditorStore>({
127
127
  _parentWrapScollEvent(event, editorStore);
128
128
  },
129
129
  });
130
+ const editorStructure = ref<VNode>(mainStrucutre());
130
131
 
131
132
  function mainStrucutre(): VNode {
132
133
  const childList: VNode[] = [];
@@ -193,6 +194,14 @@ function setAlign(align: DETextalign): void {
193
194
  _setTextAlign(align, editorStore);
194
195
  }
195
196
 
197
+ watch(
198
+ () => props.modelValue,
199
+ (newData) => {
200
+ editorStore.value.firstData = newData;
201
+ editorStructure.value = mainStrucutre();
202
+ }
203
+ );
204
+
196
205
  onMounted(() => {
197
206
  _eidtorMountEvent(editorStore);
198
207
  });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "dragon-editor",
3
- "version": "3.5.18",
3
+ "version": "3.5.19",
4
4
  "description": "Javascript WYSIWYG editor in Nuxt3!",
5
5
  "repository": {
6
6
  "type": "git",