feat(entry): 建立 MVVM+data 分层骨架,接入 V2 状态管理与 Navigation 路由

This commit is contained in:
AndyChen1024
2026-09-11 16:22:45 +08:00
parent 3a116df871
commit 058b978f25
11 changed files with 336 additions and 33 deletions

View File

@@ -0,0 +1,30 @@
/**
* 应用级导航封装:持有全局 NavPathStack,页面通过静态方法导航。
*/
export class AppRouter {
private static stack: NavPathStack | null = null;
static init(stack: NavPathStack): void {
AppRouter.stack = stack;
}
static push(name: string, param?: Object): void {
AppRouter.stack?.pushPathByName(name, param);
}
static replace(name: string, param?: Object): void {
AppRouter.stack?.replacePathByName(name, param);
}
static pop(): void {
AppRouter.stack?.pop();
}
static popToName(name: string): void {
AppRouter.stack?.popToName(name);
}
static clear(): void {
AppRouter.stack?.clear();
}
}