From bd41f96df3b017221308ce5507be22705043e210 Mon Sep 17 00:00:00 2001 From: "Jiangjie.Bai" Date: Thu, 18 Aug 2022 10:48:28 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E5=B1=9E=E6=80=A7?= =?UTF-8?q?=E6=98=A0=E5=B0=84=E5=AD=97=E6=AE=B5=E5=80=BC=E4=B8=8D=E6=98=BE?= =?UTF-8?q?=E7=A4=BA=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/AutoDataForm/index.vue | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/components/AutoDataForm/index.vue b/src/components/AutoDataForm/index.vue index 857c24bbf..0cb2360c9 100644 --- a/src/components/AutoDataForm/index.vue +++ b/src/components/AutoDataForm/index.vue @@ -79,14 +79,15 @@ export default { _cleanFormValue(form, remoteMeta) { for (const [k, v] of Object.entries(remoteMeta)) { let valueSet = form[k] - if (v.type === 'nested object') { + if (v.type === 'nested object' && v.children) { + // 有一些字段属性时 nested object 类型,但是没有 children,没有children的不需要走递归逻辑, + // 比如:认证配置中的属性映射字段 if (typeof valueSet !== 'object') { + // 处理一些前端没有设置初始值的情况 valueSet = {} } form[k] = valueSet - if (v.children) { - this._cleanFormValue(form[k], v.children) - } + this._cleanFormValue(valueSet, v.children) } if (valueSet !== undefined) { continue