目前NavDestination可以添加导航右上角按钮,可通过menus设置,具体可以参考:https://gitee.com/openharmony/docs/blob/master/zh-cn/applicat...@Entry @Component struct Index { pathStack: NavPathStack = new NavPathStack() private menuItems: Array<NavigationMenuItem> = [ { value: "1", icon: 'resources/base/media/startIcon.png', }, { value: "2", icon: 'resources/base/media/startIcon.png', isEnabled: false, }, { value: "3", icon: 'resources/base/media/startIcon.png', isEnabled: true, } ] build() { NavDestination() { Column() { Button('pushPathByName', { stateEffect: true, type: ButtonType.Capsule }) .width('80%') .height(40) .margin(20) .onClick(() => { this.pathStack.pushPathByName('pageOne', null) }) }.width('100%').height('100%') }.title('pageTwo') .menus(this.menuItems) .onBackPressed(() => { this.pathStack.pop() return true }) .onReady((context: NavDestinationContext) => { this.pathStack = context.pathStack; console.log("current page config info is " + JSON.stringify(context.getConfigInRouteMap())) }) } }
目前NavDestination可以添加导航右上角按钮,可通过menus设置,具体可以参考:https://gitee.com/openharmony/docs/blob/master/zh-cn/applicat...