diff --git a/packages/plugins/@nocobase/plugin-block-template/src/client/utils/template.ts b/packages/plugins/@nocobase/plugin-block-template/src/client/utils/template.ts index f32009378ae..ecd5f08ab27 100644 --- a/packages/plugins/@nocobase/plugin-block-template/src/client/utils/template.ts +++ b/packages/plugins/@nocobase/plugin-block-template/src/client/utils/template.ts @@ -190,6 +190,9 @@ function cleanSchema(schema?: any) { if (schema.properties[key]['x-component'] == null && shouldDeleteNoComponentSchema(schema.properties[key])) { delete schema.properties[key]; } + if (properties[key]?.['x-component-props'] === null) { + delete properties[key]['x-component-props']; + } // 如果x-component是Grid.Row,且内部无任何内容,则删除 if (properties[key]?.['x-component'] === 'Grid.Row') { let hasProperties = false; diff --git a/packages/plugins/@nocobase/plugin-block-template/src/server/utils/template.ts b/packages/plugins/@nocobase/plugin-block-template/src/server/utils/template.ts index f4e16061ce3..5cc8e2cae9d 100644 --- a/packages/plugins/@nocobase/plugin-block-template/src/server/utils/template.ts +++ b/packages/plugins/@nocobase/plugin-block-template/src/server/utils/template.ts @@ -400,6 +400,9 @@ export function cleanSchema(schema?: Schema, templateId?: string) { if (schema.properties[key]['x-template-root-uid'] && schema.properties[key]['x-template-root-uid'] !== templateId) { continue; } + if (properties[key]?.['x-component-props'] === null) { + delete properties[key]['x-component-props']; + } if (properties[key]?.['x-component'] === 'Grid.Row') { let hasProperties = false; const cols = Object.values(properties[key]?.['properties'] || {});