可以参考代码:onWindowStageCreate(windowStage: window.WindowStage) { windowStage.getMainWindow().then((windowObj) => { windowObj.setWindowLayoutFullScreen(true); windowObj.setWindowSystemBarEnable(['status']) }); } .onClick(()=>{ // 先通过上下文获取windowStage (getContext() as common.UIAbilityContext).windowStage // 获取主窗口 .getMainWindowSync().getUIContext() // 获取路由栈 .getRouter() // 推送页面 .pushUrl({ "url":"pages/Page" }) })参考链接如下:https://developer.huawei.com/consumer/cn/doc/harmonyos-guides...
可以参考代码:
参考链接如下:https://developer.huawei.com/consumer/cn/doc/harmonyos-guides...