From 6c345cb64ad2cb8a72f5dcea5e4d83d38075b549 Mon Sep 17 00:00:00 2001 From: SemmyWong <67748948+semmywong@users.noreply.github.com> Date: Wed, 10 Nov 2021 23:23:57 +0800 Subject: [PATCH] fix: upgrade formily and form.setValues uses overwrite strategy (#101) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1、formily从2.0.0-rc.3升级到2.0.0-rc.19 2、重置form没有生效,setValues参数设为override --- packages/client/package.json | 6 +- .../admin-layout/Collections/index.tsx | 8 +- yarn.lock | 124 ++++++++++-------- 3 files changed, 73 insertions(+), 65 deletions(-) diff --git a/packages/client/package.json b/packages/client/package.json index 78d92a9d8..0e33b3614 100644 --- a/packages/client/package.json +++ b/packages/client/package.json @@ -21,9 +21,9 @@ "@antv/g2plot": "^2.3.27", "@dnd-kit/core": "4.0.0-next-2021720152655", "@dnd-kit/sortable": "5.0.0-next-2021720152655", - "@formily/antd": "2.0.0-rc.3", - "@formily/core": "2.0.0-rc.3", - "@formily/react": "2.0.0-rc.3", + "@formily/antd": "2.0.0-rc.19", + "@formily/core": "2.0.0-rc.19", + "@formily/react": "2.0.0-rc.19", "@monaco-editor/react": "^4.2.1", "ahooks": "^2.10.2", "axios": "^0.21.1", diff --git a/packages/client/src/components/admin-layout/Collections/index.tsx b/packages/client/src/components/admin-layout/Collections/index.tsx index 3287dd45b..f7dc01f61 100644 --- a/packages/client/src/components/admin-layout/Collections/index.tsx +++ b/packages/client/src/components/admin-layout/Collections/index.tsx @@ -610,7 +610,7 @@ function CreateFieldButton() { key: uid(), name: `f_${uid()}`, interface: info.key, - }); + }, 'overwrite'); setProperties(clone(schema.properties)); setVisible(true); }} @@ -644,16 +644,16 @@ function CreateFieldButton() { title={t('Add field')} width={'50%'} visible={visible} - onClose={() => { + onClose={async () => { + await form.clearFormGraph(); setVisible(false); - form.reset(); }} footer={