From 87971f4de18a5079728fff8cb6bf4320ee908716 Mon Sep 17 00:00:00 2001 From: "zhili.wzl" Date: Sat, 13 Nov 2021 11:01:27 +0800 Subject: [PATCH] fix(formily): fix reactionSetters and playground --- formily/antd/playground/widgets/MarkupSchemaWidget.tsx | 2 +- formily/next/playground/widgets/MarkupSchemaWidget.tsx | 2 +- formily/setters/src/components/ReactionsSetter/properties.ts | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/formily/antd/playground/widgets/MarkupSchemaWidget.tsx b/formily/antd/playground/widgets/MarkupSchemaWidget.tsx index 231a88746..7d92daa40 100644 --- a/formily/antd/playground/widgets/MarkupSchemaWidget.tsx +++ b/formily/antd/playground/widgets/MarkupSchemaWidget.tsx @@ -10,7 +10,7 @@ export interface IMarkupSchemaWidgetProps { const transformToMarkupSchemaCode = (tree: TreeNode) => { const printAttribute = (node: TreeNode) => { if (!node) return '' - return `${Object.keys(node.props || {}) + return `${Object.keys({ ...node.props, name: node.props.name || node.id }) .map((key) => { if ( key === 'x-designable-id' || diff --git a/formily/next/playground/widgets/MarkupSchemaWidget.tsx b/formily/next/playground/widgets/MarkupSchemaWidget.tsx index 272eb1c46..aa95bb6a2 100644 --- a/formily/next/playground/widgets/MarkupSchemaWidget.tsx +++ b/formily/next/playground/widgets/MarkupSchemaWidget.tsx @@ -10,7 +10,7 @@ export interface IMarkupSchemaWidgetProps { const transformToMarkupSchemaCode = (tree: TreeNode) => { const printAttribute = (node: TreeNode) => { if (!node) return '' - return `${Object.keys(node.props || {}) + return `${Object.keys({ ...node.props, name: node.props.name || node.id }) .map((key) => { if ( key === 'x-designable-id' || diff --git a/formily/setters/src/components/ReactionsSetter/properties.ts b/formily/setters/src/components/ReactionsSetter/properties.ts index 25c2dffce..bd0a848d0 100644 --- a/formily/setters/src/components/ReactionsSetter/properties.ts +++ b/formily/setters/src/components/ReactionsSetter/properties.ts @@ -37,13 +37,13 @@ export const FieldProperties = [ helpCode: DataSourceHelper, }, { - key: 'component[1]', + key: 'componentProps', token: 'componentProps', type: 'object', helpCode: ComponentPropsHelper, }, { - key: 'decorator[1]', + key: 'componentProps', token: 'decoratorProps', type: 'object', helpCode: DecoratorPropsHelper,