From 7bc6746f0b63786e15784b63e2a2b3801b39e766 Mon Sep 17 00:00:00 2001 From: Junyi Date: Sat, 27 Jul 2024 22:11:49 +0800 Subject: [PATCH] fix(client): fix variable input value type (#4955) --- .../src/schema-component/antd/variable/Input.tsx | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/packages/core/client/src/schema-component/antd/variable/Input.tsx b/packages/core/client/src/schema-component/antd/variable/Input.tsx index 3e96698511..ee5cf89ae8 100644 --- a/packages/core/client/src/schema-component/antd/variable/Input.tsx +++ b/packages/core/client/src/schema-component/antd/variable/Input.tsx @@ -123,10 +123,10 @@ function getTypedConstantOption(type: string, types: true | string[], fieldNames Object.keys(item).reduce( (result, key) => fieldNames[key] in item - ? result - : Object.assign(result, { + ? Object.assign(result, { [fieldNames[key]]: item[key], - }), + }) + : result, item, ), ); @@ -397,9 +397,9 @@ export function Input(props: VariableInputProps) {
{children && isFieldValue ? ( children - ) : ( + ) : ConstantComponent ? ( - )} + ) : null}
)}