mirror of
https://github.com/Gongxh0901/kunpolibrary
synced 2025-07-01 13:54:32 +00:00
fix: 修复自定义组件属性序列化失败的问题
This commit is contained in:
parent
4108223407
commit
58abdfae52
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user