From cdc2d62842df31ce0133c3da07b054eb8acce54f Mon Sep 17 00:00:00 2001 From: Junyi Date: Fri, 18 Oct 2024 22:58:48 +0800 Subject: [PATCH] feat(client): support json input in variable input (#5453) --- .../client/src/schema-component/antd/variable/Input.tsx | 9 +++++++++ 1 file changed, 9 insertions(+) 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 80b88914e5..3d61b74a4e 100644 --- a/packages/core/client/src/schema-component/antd/variable/Input.tsx +++ b/packages/core/client/src/schema-component/antd/variable/Input.tsx @@ -21,6 +21,7 @@ import { useTranslation } from 'react-i18next'; import { useCompile } from '../../hooks'; import { XButton } from './XButton'; import { useStyles } from './style'; +import { Json } from '../input'; const JT_VALUE_RE = /^\s*{{\s*([^{}]+)\s*}}\s*$/; @@ -124,6 +125,14 @@ const ConstantTypes = { return null; }, }, + object: { + label: '{{t("JSON")}}', + value: 'object', + component: Json, + default() { + return {}; + }, + }, }; type UseTypeConstantType = true | (string | [string, Record])[];