From 58abdfae521ed9d7f73509f5ebc221ecd99257ad Mon Sep 17 00:00:00 2001 From: gongxh Date: Mon, 30 Jun 2025 15:17:25 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E8=87=AA=E5=AE=9A?= =?UTF-8?q?=E4=B9=89=E7=BB=84=E4=BB=B6=E5=B1=9E=E6=80=A7=E5=BA=8F=E5=88=97?= =?UTF-8?q?=E5=8C=96=E5=A4=B1=E8=B4=A5=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/ui/ComponentExtendHelper.ts | 2 +- src/ui/PropsHelper.ts | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ui/ComponentExtendHelper.ts b/src/ui/ComponentExtendHelper.ts index 8189908..06e4095 100644 --- a/src/ui/ComponentExtendHelper.ts +++ b/src/ui/ComponentExtendHelper.ts @@ -24,7 +24,7 @@ export class ComponentExtendHelper { private static registerComponent(ctor: any, pkg: string, name: string): void { // 自定义组件扩展 const onConstruct = function (this: any): void { - PropsHelper.serializeProps(this, pkg); + PropsHelper.serializeProps(this, pkg, name); this.onInit && this.onInit(); }; ctor.prototype.onConstruct = onConstruct; diff --git a/src/ui/PropsHelper.ts b/src/ui/PropsHelper.ts index b418403..74dd456 100644 --- a/src/ui/PropsHelper.ts +++ b/src/ui/PropsHelper.ts @@ -28,7 +28,7 @@ export class PropsHelper { } /** 序列化属性 @internal */ - public static serializeProps(component: GComponent, packageName: string): void { + public static serializeProps(component: GComponent, packageName: string, componentName?: string): void { if (!this._config) { return; } @@ -36,7 +36,7 @@ export class PropsHelper { if (!config) { return; } - const componentName = component.name; + componentName = componentName || component.name; const propsInfo = config[componentName]; if (!propsInfo) { return;