@cc-component/cc-core 1.6.4 → 1.6.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -447,7 +447,7 @@ export class App {
|
|
|
447
447
|
}
|
|
448
448
|
|
|
449
449
|
// 通过配置关闭窗口
|
|
450
|
-
static CloseWindowTarget(config: IBundleConfig): boolean { return App.CloseWindow(config.path.split('/').pop()); }
|
|
450
|
+
static CloseWindowTarget(config: IBundleConfig): boolean { return App.CloseWindow(config.name ?? config.path.split('/').pop()!); }
|
|
451
451
|
|
|
452
452
|
// 关闭所有窗口
|
|
453
453
|
static CloseAllWindows(): number {
|
|
@@ -468,7 +468,7 @@ export class App {
|
|
|
468
468
|
static IsWindowOpen(className: string): boolean { return App.Ins.openedWindows.has(className); }
|
|
469
469
|
// 获取已打开的窗口实例
|
|
470
470
|
static GetOpenWindow<T extends Component>(config: IBundleConfig): T {
|
|
471
|
-
const className = config.path.split('/').pop();
|
|
471
|
+
const className = config.name ?? config.path.split('/').pop();
|
|
472
472
|
const window = App.Ins.openedWindows.get(className);
|
|
473
473
|
return window ? window as T : null;
|
|
474
474
|
}
|