From 8d27d53ab6d9d35317cd0b6441c78c0c6957f817 Mon Sep 17 00:00:00 2001 From: lhuans Date: Tue, 31 Oct 2023 20:42:58 -0700 Subject: [PATCH 1/3] =?UTF-8?q?fix:=20=E7=94=BB=E5=B8=83=E4=B8=AD=E5=8F=B3?= =?UTF-8?q?=E9=94=AE=E5=BC=B9=E6=A1=86=EF=BC=8C=E4=BF=AE=E5=A4=8D=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=88=B6=E7=BA=A7-=E5=BC=B9=E5=87=BA=E6=A1=86?= =?UTF-8?q?=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/components/container/CanvasMenu.vue | 42 +++++++++++++++++-- 1 file changed, 39 insertions(+), 3 deletions(-) diff --git a/packages/canvas/src/components/container/CanvasMenu.vue b/packages/canvas/src/components/container/CanvasMenu.vue index 42de1355cd..eb85fa4bdf 100644 --- a/packages/canvas/src/components/container/CanvasMenu.vue +++ b/packages/canvas/src/components/container/CanvasMenu.vue @@ -126,13 +126,49 @@ export default { const componentName = value || name const { schema, parent } = getCurrent() const index = parent.children.indexOf(schema) - const wrapSchema = { + let wrapSchema = { componentName, id: null, - props: {}, + props: { + content: '提示信息' + }, children: [schema] } - + // 需要对popover特殊处理 + if (value === 'TinyPopover') { + wrapSchema = { + componentName, + props: { + width: 200, + title: '弹框标题', + trigger: 'manual', + modelValue: true + }, + children: [ + { + componentName: 'Template', + props: { + slot: 'reference' + }, + children: [schema] + }, + { + componentName: 'Template', + props: { + slot: 'default' + }, + children: [ + { + componentName: 'div', + props: { + placeholder: '提示内容' + } + } + ] + } + ] + } + } parent.children.splice(index, 1, wrapSchema) getController().addHistory() From e9f4a10d85aa3beaa29d451328d696059a57f099 Mon Sep 17 00:00:00 2001 From: lhuans Date: Fri, 1 Dec 2023 02:06:16 -0800 Subject: [PATCH 2/3] =?UTF-8?q?fix:=20schema=E7=BC=BA=E5=B0=91children?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/canvas/src/components/container/CanvasMenu.vue | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/packages/canvas/src/components/container/CanvasMenu.vue b/packages/canvas/src/components/container/CanvasMenu.vue index 1a487f2e6d..993e358449 100644 --- a/packages/canvas/src/components/container/CanvasMenu.vue +++ b/packages/canvas/src/components/container/CanvasMenu.vue @@ -162,7 +162,12 @@ export default { props: { slot: 'reference' }, - children: [schema] + children: [ + { + componentName: 'div', + children: [schema] + } + ] }, { componentName: 'Template', From 238e5763d5c2888e290ad6f506e5b5886bbc3c69 Mon Sep 17 00:00:00 2001 From: lhuans Date: Sun, 3 Dec 2023 22:52:58 -0800 Subject: [PATCH 3/3] =?UTF-8?q?fix:=20=E6=8C=89=E6=A3=80=E8=A7=86=E6=84=8F?= =?UTF-8?q?=E8=A7=81=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- packages/canvas/src/components/container/CanvasMenu.vue | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/packages/canvas/src/components/container/CanvasMenu.vue b/packages/canvas/src/components/container/CanvasMenu.vue index 993e358449..c03ee387d8 100644 --- a/packages/canvas/src/components/container/CanvasMenu.vue +++ b/packages/canvas/src/components/container/CanvasMenu.vue @@ -137,7 +137,7 @@ export default { return } - const index = parent.children.indexOf(schema) + const index = parent.children.findIndex(({ id }) => schema.id === id) let wrapSchema = { componentName, id: null, @@ -162,12 +162,7 @@ export default { props: { slot: 'reference' }, - children: [ - { - componentName: 'div', - children: [schema] - } - ] + children: [schema] }, { componentName: 'Template',