README_zh.md

ArkUI使用导航组件指南文档示例

介绍

本示例通过使用ArkUI指南文档中各场景的开发示例,展示在工程中,帮助开发者更好地理解ArkUI提供的组件及组件属性并合理使用。该工程中展示的代码详细描述可查如下链接:

  1. Navigation
  2. NavDestination
  3. 无感监听
  4. SideBarContainer
  5. NavPathStack派生类
  6. Router
  7. Router切换Navigation
  8. 页面路由 (@ohos.router)(不推荐)

效果预览

首页

使用说明

  1. 在主界面,可以点击对应卡片,选择需要参考的组件示例。

  2. 在组件目录选择详细的示例参考。

  3. 进入示例界面,查看参考示例。

  4. 通过自动测试框架可进行测试及维护。

工程目录

entry/src/main/ets/
|---entryability
|---pages
|   |---navDestination                       // NavDestination 
|   |   |---template1
|   |   |   |---Index.ets
|   |   |---template2
|   |   |   |---Index.ets
|   |   |---template3
|   |   |   |---Index.ets
|   |   |---template4
|   |   |   |---Index.ets
|   |---navigation                      // Navigation
|   |   |---template1
|   |   |   |---Index.ets
|   |   |---template2
|   |   |   |---Index.ets    
|   |   |---template3
|   |   |   |---Index.ets    
|   |   |---template4
|   |   |   |---Index.ets    
|   |   |---template5
|   |   |   |---Index.ets    
|   |   |---template6
|   |   |   |---Index.ets    
|   |   |---template7
|   |   |   |---Index.ets    
|   |   |---template8
|   |   |   |---Index.ets    
|   |   |---template9
|   |   |   |---Index.ets    
|   |   |---template10
|   |   |   |---Index.ets      
|   |   |---template11
|   |   |   |---Index.ets    
|   |   |---template12
|   |   |   |---Index.ets    
|   |   |---template13
|   |   |   |---Index.ets      
|   |---navPathStackExtend                             // NavPathStack派生类
|   |   |---template1
|   |   |   |---Index.ets
|   |---observer              // 无感监听
|   |   |---template1
|   |   |   |---Index.ets
|   |   |---template2
|   |   |   |---Index.ets
|   |   |---template3
|   |   |   |---Index.ets
|   |   |---template4
|   |   |   |---Index.ets
|   |---pageRouter                  // 页面路由
|   |   |---backPage
|   |   |   |---Home.ets
|   |   |---jumpPage
|   |   |   |---Index.ets
|   |   |   |---IndexPara.ets
|   |   |   |---BackHome.ets
|   |   |   |---Login.ets
|   |   |   |---Setting.ets
|   |   |   |---SearchResule.ets
|   |   |---lifeCycle
|   |   |   |---Index.ets   
|   |   |   |---Page.ets 
|   |   |---pageTransition
|   |   |   |---ShowAlert.ets   
|   |   |   |---ShowDialog.ets 
|   |---router                  // Router
|   |   |---template1
|   |   |   |---Index.ets
|   |---routerToNavigation                 // routerToNavigation
|   |   |---lifeCycle
|   |   |   |---Index.ets   
|   |   |---navigation
|   |   |   |---Index.ets
|   |   |---navPathStack
|   |   |   |---Index.ets  
|   |   |---observer
|   |   |   |---Index.ets  
|   |   |---router
|   |   |   |---Index.ets  
|   |---sideBarContainer                 // SideBarContainer
|   |   |---template1
|   |   |   |---Index.ets 
|---pages
|   |---Index.ets                       // 应用主页面
entry/src/ohosTest/
|---ets
|   |---test
|   |   |---NavDestination.test.ets                      // NavDestination示例代码测试代码
|   |   |---Navigation.test.ets                         // Navigation示例代码测试代码
|   |   |---QueryNavDestinationInfo.test.ets                         // NavPathStack派生类示例代码测试代码
|   |   |---Router.test.ets                       // Router示例代码测试代码
|   |   |---RouterToNavigation.test.ets           // Router切换Navigation
|   |   |---SideBarContainer.test.ets                       // SideBarContainer示例代码测试代码
|   |   |---UiObserver.test.ets                    // 无感监听示例代码测试代码

相关权限

不涉及。

依赖

不涉及。

约束与限制

  1. 本示例仅支持标准系统上运行, 支持设备:华为手机。

  2. HarmonyOS系统:HarmonyOS 5.0.5 Release及以上。

  3. DevEco Studio版本:6.0.0 Release及以上。

  4. HarmonyOS SDK版本:HarmonyOS 6.0.0 Release SDK及以上。

下载

如需单独下载本工程,执行如下命令:

git init
git config core.sparsecheckout true
echo ArkUISample/Navigation > .git/info/sparse-checkout
git remote add origin https://gitcode.com/harmonyos_samples/guide-snippets.git
git pull origin master