mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-06-03 14:11:10 +00:00
feat: update pane init function
This commit is contained in:
parent
8072de1bf7
commit
74a75c976f
@ -66,6 +66,7 @@ function upgradeConfig(config: OldPaneConfig): IWidgetBaseConfig & { area: strin
|
|||||||
contentProps: props,
|
contentProps: props,
|
||||||
index: index || props?.index,
|
index: index || props?.index,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (type === 'dock') {
|
if (type === 'dock') {
|
||||||
newConfig.type = 'PanelDock';
|
newConfig.type = 'PanelDock';
|
||||||
newConfig.area = 'left';
|
newConfig.area = 'left';
|
||||||
@ -98,8 +99,6 @@ function upgradeConfig(config: OldPaneConfig): IWidgetBaseConfig & { area: strin
|
|||||||
height,
|
height,
|
||||||
maxHeight,
|
maxHeight,
|
||||||
canSetFixed,
|
canSetFixed,
|
||||||
onInit: init,
|
|
||||||
onDestroy: destroy,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
if (defaultFixed) {
|
if (defaultFixed) {
|
||||||
@ -121,23 +120,21 @@ function upgradeConfig(config: OldPaneConfig): IWidgetBaseConfig & { area: strin
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
} else if (type === 'action') {
|
||||||
|
newConfig.area = 'top';
|
||||||
|
newConfig.type = 'Dock';
|
||||||
|
} else if (type === 'tab') {
|
||||||
|
newConfig.area = 'right';
|
||||||
|
newConfig.type = 'Panel';
|
||||||
|
} else if (type === 'stage') {
|
||||||
|
newConfig.area = 'stages';
|
||||||
|
newConfig.type = 'Widget';
|
||||||
} else {
|
} else {
|
||||||
newConfig.props.onInit = init;
|
newConfig.area = 'main';
|
||||||
newConfig.props.onDestroy = destroy;
|
newConfig.type = 'Widget';
|
||||||
if (type === 'action') {
|
|
||||||
newConfig.area = 'top';
|
|
||||||
newConfig.type = 'Dock';
|
|
||||||
} else if (type === 'tab') {
|
|
||||||
newConfig.area = 'right';
|
|
||||||
newConfig.type = 'Panel';
|
|
||||||
} else if (type === 'stage') {
|
|
||||||
newConfig.area = 'stages';
|
|
||||||
newConfig.type = 'Widget';
|
|
||||||
} else {
|
|
||||||
newConfig.area = 'main';
|
|
||||||
newConfig.type = 'Widget';
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
newConfig.props.onInit = init;
|
||||||
|
newConfig.props.onDestroy = destroy;
|
||||||
|
|
||||||
return newConfig;
|
return newConfig;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -141,6 +141,13 @@ export default class PanelDock implements IWidget {
|
|||||||
showPanel() {
|
showPanel() {
|
||||||
this.panel?.setActive(true);
|
this.panel?.setActive(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @deprecated
|
||||||
|
*/
|
||||||
|
onActiveChange(func: () => any) {
|
||||||
|
return this.panel?.onActiveChange(func);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user