From e57777e337cb9890a52329db1352b3346097788f Mon Sep 17 00:00:00 2001 From: jenesius Date: Tue, 23 May 2023 21:12:25 +0300 Subject: [PATCH] feat: modify dispatch event. Add recursive dispatching event to children depends. --- project/pages/test/App.vue | 9 ++- project/pages/test/input-coord.vue | 8 ++- project/pages/test/widget-composite.vue | 8 ++- src/classes/CompareEvent.ts | 13 ++++ src/classes/DependencyQueue.ts | 13 ++-- src/classes/Form.ts | 87 +++++++++++++++++-------- 6 files changed, 97 insertions(+), 41 deletions(-) diff --git a/project/pages/test/App.vue b/project/pages/test/App.vue index 6d27170..c78b3f6 100644 --- a/project/pages/test/App.vue +++ b/project/pages/test/App.vue @@ -9,7 +9,7 @@ -
{{values}}
+
{{count}}
@@ -19,6 +19,7 @@ import FormField from "./../../../src/widgets/form-field.vue"; import {ref} from "vue"; import WidgetComposite from "./widget-composite.vue"; import WidgetAddress from "./widget-address.vue" +import copyObject from "./../../../src/utils/copy-object"; const form = new Form({ name: "main" @@ -27,8 +28,9 @@ const form = new Form({ window.form = form const count = ref(0); -setInterval(() => count.value++, 50); -const values = ref(form.values); +setInterval(() => { + count.value = copyObject(form.values); +}, 50); const name = ref('username'); @@ -41,6 +43,7 @@ function clean() { function setDefaultValues() { return form.cleanValues({ username: "Jenesius", + "coordinate.x": "123" }) } diff --git a/project/pages/test/input-coord.vue b/project/pages/test/input-coord.vue index 89666f5..b32c4a0 100644 --- a/project/pages/test/input-coord.vue +++ b/project/pages/test/input-coord.vue @@ -1,5 +1,6 @@