From c71bbf625351daf95a543158688fdc1be943a084 Mon Sep 17 00:00:00 2001 From: lloyd <353627866@qq.com> Date: Thu, 18 Sep 2025 15:22:45 +0800 Subject: [PATCH] =?UTF-8?q?=E3=80=90=E5=9F=BA=E4=BA=8E=E7=B3=BB=E7=BB=9F?= =?UTF-8?q?=E8=B7=AF=E7=94=B1=E8=A1=A8=E5=AE=9E=E7=8E=B0=E9=A1=B5=E9=9D=A2?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E3=80=91=E8=A1=A5=E5=85=85=E5=8F=A5=E5=8F=B7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.en.md | 16 ++++++++-------- README.md | 22 +++++++++++----------- 2 files changed, 19 insertions(+), 19 deletions(-) diff --git a/README.en.md b/README.en.md index 6bee1ac..21e3597 100644 --- a/README.en.md +++ b/README.en.md @@ -1,22 +1,22 @@ # Navigation System Route -### Overview +## Overview This sample provides system route verification. The system route table redirects to the page of a module (HSP/HAR), without the need to configure the dependency between different modules to jump. When a page is redirected, the page not redirected and loaded page will not be loaded. This resolves the dependency and coupling issues across different modules and the excessive loading time of the home page. Due to environment differences, you are not advised to compile the code after downloading it. Instead, you need to create a project and compile the code by referring to the sample code. -### Preview +## Preview ![image](screenshots/device/navigation_router.gif) -### How to Use +## How to Use 1. The home page provides a **NavIndex** navigation page. You can tap buttons to go to different pages from HARs and HSPs. 2. Each HAR or HSP page also provides buttons for jumping to other pages. -### Project Directory +## Project Directory ``` ├──entry/src/main/ets/ @@ -36,7 +36,7 @@ Due to environment differences, you are not advised to compile the code after do └──hspB ``` -### How to Implement +## How to Implement 1. Create hapA, harA, hspA, and hspB. @@ -48,11 +48,11 @@ Due to environment differences, you are not advised to compile the code after do 5. The application can call **pushDestinationByName** to obtain the error information about the target page. -### Required Permissions +## Required Permissions N/A -### Constraints +## Constraints 1. The sample is only supported on Huawei phones with standard systems. @@ -62,6 +62,6 @@ N/A 4. The HarmonyOS SDK version must be HarmonyOS 5.0.5 Release SDK or later. -### Note +## Note All HSP modules need to be referenced during running. Tap **Run** > **entry** to start building your app or service after completing running settings. diff --git a/README.md b/README.md index c35a79a..95fdb5a 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,20 @@ # 基于系统路由表实现页面跳转 -### 介绍 +## 介绍 本项目提供系统路由的验证,运用系统路由表的方式,跳转到模块(HSP/HAR)的页面,可以不用配置不同跳转模块间的依赖。当发生页面跳转时,未跳转页面不会加载,已经加载过的页面不会再次加载。 解决了不同模块依赖耦合的问题,以及首页加载时间长的问题。 -### 效果预览 +## 效果预览 ![image](screenshots/device/navigation_router.gif) -使用说明 +## 使用说明 -1. 主页会提供一个NavIndex的导航页,点击按钮会跳转到不同的来自HAR和HSP包的页面 +1. 主页会提供一个NavIndex的导航页,点击按钮会跳转到不同的来自HAR和HSP包的页面。 -2. 每个HAR和HSP包的页面也存在跳转到别的页面的按钮 +2. 每个HAR和HSP包的页面也存在跳转到别的页面的按钮。 -### 工程目录 +## 工程目录 ``` ├──entry/src/main/ets/ @@ -34,19 +34,19 @@ └──hspB ``` -### 具体实现 +## 具体实现 -1.创建hapA harA hspA hspB +1.创建hapA harA hspA hspB。 -2.在跳转目标模块的配置文件module.json5添加路由表配置 +2.在跳转目标模块的配置文件module.json5添加路由表配置。 -3.添加完路由配置文件地址后,需要在工程resources/base/profile中创建route_map.json文件 +3.添加完路由配置文件地址后,需要在工程resources/base/profile中创建route_map.json文件。 4.在跳转目标页面中,需要配置入口Builder函数,函数名称需要和router_map.json配置文件中的buildFunction保持一致。 5.应用通过调用pushDestinationByName等方式,可以获取跳转目标页面的错误信息。 -### 相关权限 +## 相关权限 不涉及 -- Gitee