From d1ac0a9bd5c4f1ffd1e5da81b0a707230eec4f23 Mon Sep 17 00:00:00 2001 From: Kinplemelon Date: Wed, 18 Dec 2024 17:17:23 +0800 Subject: [PATCH] fix(action): default value of boolean enums --- src/hooks/Rule/bridge/useComponentsHandlers.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/src/hooks/Rule/bridge/useComponentsHandlers.ts b/src/hooks/Rule/bridge/useComponentsHandlers.ts index 79a070b1b..9be62d6b9 100644 --- a/src/hooks/Rule/bridge/useComponentsHandlers.ts +++ b/src/hooks/Rule/bridge/useComponentsHandlers.ts @@ -81,6 +81,7 @@ export default ( } else if (prop.type === 'boolean' && prop.is_template) { prop.type = 'enum' prop.symbols = [true, false] + prop.default ??= '' } else if (prop.type === 'object' && !prop.properties && prop.is_template) { setComponentProps(prop, { supportPlaceholder: ['key', 'value'] }) }