From 7957dc2c18e3f316acc3d7bcbdb3019409da2df5 Mon Sep 17 00:00:00 2001 From: xiaoxian521 <1923740402@qq.com> Date: Wed, 10 May 2023 01:47:43 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E5=87=BD=E6=95=B0=E5=BC=8F=E5=BC=B9?= =?UTF-8?q?=E6=A1=86=E7=BB=84=E4=BB=B6=E6=B7=BB=E5=8A=A0=E7=BB=93=E5=90=88?= =?UTF-8?q?`Form`=E7=9A=84`demo`=E7=A4=BA=E4=BE=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/ReDialog/type.ts | 6 +- src/views/components/dialog/form.vue | 45 ++++++++++ src/views/components/dialog/index.vue | 115 +++++++++++++++++++++++++- 3 files changed, 162 insertions(+), 4 deletions(-) create mode 100644 src/views/components/dialog/form.vue diff --git a/src/components/ReDialog/type.ts b/src/components/ReDialog/type.ts index 742feef2a..5ccd78aee 100644 --- a/src/components/ReDialog/type.ts +++ b/src/components/ReDialog/type.ts @@ -128,7 +128,7 @@ interface DialogOptions extends DialogProps { close: Function; titleId: string; titleClass: string; - }) => VNode; + }) => VNode | Component; /** 自定义内容渲染器 */ contentRenderer?: ({ options, @@ -136,7 +136,7 @@ interface DialogOptions extends DialogProps { }: { options: DialogOptions; index: number; - }) => VNode; + }) => VNode | Component; /** 自定义按钮操作区的内容渲染器,会覆盖`footerButtons`以及默认的 `取消` 和 `确定` 按钮 */ footerRenderer?: ({ options, @@ -144,7 +144,7 @@ interface DialogOptions extends DialogProps { }: { options: DialogOptions; index: number; - }) => VNode; + }) => VNode | Component; /** 自定义底部按钮操作 */ footerButtons?: Array; /** `Dialog` 打开后的回调 */ diff --git a/src/views/components/dialog/form.vue b/src/views/components/dialog/form.vue new file mode 100644 index 000000000..b6847d15a --- /dev/null +++ b/src/views/components/dialog/form.vue @@ -0,0 +1,45 @@ + + + diff --git a/src/views/components/dialog/index.vue b/src/views/components/dialog/index.vue index 92e791960..2db17c545 100644 --- a/src/views/components/dialog/index.vue +++ b/src/views/components/dialog/index.vue @@ -1,6 +1,8 @@