From 60ada2d7d9b92411ef77df73d9ef88553b993cc8 Mon Sep 17 00:00:00 2001 From: lloyd <754415+llince@user.noreply.gitee.com> Date: Thu, 27 Feb 2025 16:10:54 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=9F=BA=E4=BA=8E=E8=B7=AF=E7=94=B1?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E5=92=8C=E5=8A=A8=E6=80=81=E5=8A=A0=E8=BD=BD?= =?UTF-8?q?=E5=AE=9E=E7=8E=B0=E5=BA=94=E7=94=A8=E9=A1=B5=E9=9D=A2=E8=B7=AF?= =?UTF-8?q?=E7=94=B1=E5=AF=BC=E8=88=AA=E5=8A=9F=E8=83=BD=E3=80=91=E6=9B=B4?= =?UTF-8?q?=E6=96=B0=E7=BA=A6=E6=9D=9F=E4=B8=8E=E9=99=90=E5=88=B6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.en.md | 13 +++++++++---- README.md | 9 ++++++++- 2 files changed, 17 insertions(+), 5 deletions(-) diff --git a/README.en.md b/README.en.md index 06da7f4..e117a1b 100644 --- a/README.en.md +++ b/README.en.md @@ -1,9 +1,11 @@ # App Navigation Design ### Overview + This sample uses an independent router module and dynamic loading method to resolve the issue of routing dependency coupling between multiple HARs/HSPs under a **Navigation** component. ### Preview + ![Route navigation effect preview](screenshots/device/demonstration.en.gif) ### Project Directory @@ -53,6 +55,7 @@ This sample uses an independent router module and dynamic loading method to reso ``` ### How to Implement + 1. Extract the routing feature as an independent module named RouterModule in the format of a .har package. 2. The RouterModule manages routes internally and exposes a RouterModule object for other modules to use. 3. Use the main entry module as the dependency registration center of service modules. Use the **Navigation** component in the entry module and configure its dependencies on the service modules. @@ -61,13 +64,15 @@ This sample uses an independent router module and dynamic loading method to reso ![Module dependencies](screenshots/device/module_dependency.jpg) ### Required Permissions + N/A + ### Constraints -1. The sample app is supported only on Huawei phones running the standard system. +1. The sample is only supported on Huawei phones with standard systems. -2. The HarmonyOS version must be HarmonyOS NEXT Developer Beta1 or later. +2. The HarmonyOS version must be HarmonyOS 5.0.0 Release or later. -3. The DevEco Studio version must be DevEco Studio NEXT Developer Beta1 or later. +3. The DevEco Studio version must be DevEco Studio 5.0.0 Release or later. -4. The HarmonyOS SDK version must be HarmonyOS NEXT Developer Beta1 or later. +4. The HarmonyOS SDK version must be HarmonyOS 5.0.0 Release SDK or later. diff --git a/README.md b/README.md index 34c0b20..1ee3c66 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,17 @@ # 基于路由模块和动态加载实现应用页面路由导航功能 ### 介绍 + 通过设计单独的路由模块和动态加载方法,将路由功能抽取为单独的模块供其他模块使用,实现业务模块间的解耦。帮助开发者在页面跳转开发场景中,解决了一个Navigation组件下多har/hsp间路由跳转依赖耦合问题。 ### 效果预览 + ![路由导航效果预览](screenshots/device/demonstration.gif) ### 工程目录 + 工程的目录结构 + ``` ├──entry // 入口模块 │ ├──build-profile.json5 // 编译配置文件,其中arkOptions需配置动态import依赖的包名 @@ -53,6 +57,7 @@ ``` ### 具体实现 + 1. 将路由功能抽取成单独的模块并以har包形式存在,命名为RouterModule。 2. RouterModule内部对路由进行管理,对外暴露RouterModule对象供其他模块使用。 3. 将主入口模块作为其他业务模块的依赖注册中心,在入口模块中使用Navigation组件并依赖其他业务模块。 @@ -61,7 +66,9 @@ ![路由导航效果预览](screenshots/device/module_dependency.jpg) ### 相关权限 + 不涉及。 + ### 约束与限制 1. 本示例仅支持标准系统上运行,支持设备:华为手机。 @@ -70,4 +77,4 @@ 3. DevEco Studio版本:DevEco Studio 5.0.0 Release及以上。 -4. HarmonyOS SDK版本:HarmonyOS 5.0.0 Release SDK及以上。 \ No newline at end of file +4. HarmonyOS SDK版本:HarmonyOS 5.0.0 Release SDK及以上。 -- Gitee