From 4a30d7fb374663df3afc5796f3bc71a87cbb302a Mon Sep 17 00:00:00 2001 From: lhj <403133128@qq.com> Date: Wed, 2 Oct 2024 21:31:37 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BAcomponent=E6=B7=BB=E5=8A=A0id=EF=BC=8C?= =?UTF-8?q?=E5=B9=B6=E5=A2=9E=E5=8A=A0=E7=82=B9=E5=87=BB=E8=8E=B7=E5=8F=96?= =?UTF-8?q?=E7=BB=84=E4=BB=B6id=E7=9A=84=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/DynamicComponent.vue | 33 +++++++++++++++-------------- src/components/MainView.vue | 3 ++- src/components/NestedFunction.vue | 4 ++-- src/schemes/components/Card.json | 2 +- src/type/IComponent.js | 2 ++ 5 files changed, 24 insertions(+), 20 deletions(-) create mode 100644 src/type/IComponent.js diff --git a/src/components/DynamicComponent.vue b/src/components/DynamicComponent.vue index 250b4ba..c7dd827 100644 --- a/src/components/DynamicComponent.vue +++ b/src/components/DynamicComponent.vue @@ -1,19 +1,16 @@ - - \ No newline at end of file diff --git a/src/components/MainView.vue b/src/components/MainView.vue index 3e585ce..7c4ecb3 100644 --- a/src/components/MainView.vue +++ b/src/components/MainView.vue @@ -78,7 +78,8 @@ useDraggable(el2, componentsList, { }, clone(element: Record<'id' | 'name' | 'type' | 'children' | 'props' | 'text' | 'class' | 'style' | 'slots', any>) { return { - id: `${element.id}-${uuid()}`, + // id: `${element.id}-${uuid()}`, + id: uuid(), name: element.name, type: element.type, props: element.props, diff --git a/src/components/NestedFunction.vue b/src/components/NestedFunction.vue index f35782a..2171925 100644 --- a/src/components/NestedFunction.vue +++ b/src/components/NestedFunction.vue @@ -11,7 +11,7 @@