目录

Navigation Architecture

The Navigation component is used to implement redirection between NavDestination pages, pass parameters between different NavDestination pages, and provide flexible stack redirections to facilitate access to and reuse of different pages.

Overall Architecture

The Navigation component structure is complex and contains the following key concepts:

Figure 1 Overall Navigation architecture

In addition, Navigation provides the following layout modes:

Title Bar

The title bar is at the top of the page and displays the page name and operation entries. The Navigation component uses the title attribute to set the title content and the titleMode attribute to set the title bar mode. The NavDestination component also supports the title attribute to set the title content.

If the Navigation component does not set attributes such as title, titleMode, and menus, the back button is not displayed even if hideBackButton is set to false.

Toolbar

The toolbar is located at the bottom of the component. You can set the toolbar of Navigation using the toolbarConfiguration attribute. Similarly, you can use the toolbarConfiguration attribute to set the toolbar of NavDestination.

Figure 8 Toolbar

let toolTmp: ToolbarItem = {
  'value': 'func',
  'icon': 'ets/pages/navigation/template1/image/ic_public_highlights.svg',
  'action': () => {}
};
let toolBar: ToolbarItem[] = [toolTmp,toolTmp,toolTmp];
// ...
      Navigation(this.navPathStack) {
        // ...
      }
      .toolbarConfiguration(toolBar)