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,
|
||||
index: index || props?.index,
|
||||
};
|
||||
|
||||
if (type === 'dock') {
|
||||
newConfig.type = 'PanelDock';
|
||||
newConfig.area = 'left';
|
||||
@ -98,8 +99,6 @@ function upgradeConfig(config: OldPaneConfig): IWidgetBaseConfig & { area: strin
|
||||
height,
|
||||
maxHeight,
|
||||
canSetFixed,
|
||||
onInit: init,
|
||||
onDestroy: destroy,
|
||||
};
|
||||
|
||||
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 {
|
||||
newConfig.props.onInit = init;
|
||||
newConfig.props.onDestroy = destroy;
|
||||
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.area = 'main';
|
||||
newConfig.type = 'Widget';
|
||||
}
|
||||
newConfig.props.onInit = init;
|
||||
newConfig.props.onDestroy = destroy;
|
||||
|
||||
return newConfig;
|
||||
}
|
||||
|
||||
@ -141,6 +141,13 @@ export default class PanelDock implements IWidget {
|
||||
showPanel() {
|
||||
this.panel?.setActive(true);
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated
|
||||
*/
|
||||
onActiveChange(func: () => any) {
|
||||
return this.panel?.onActiveChange(func);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user