From 5ae7c753453f77ed57234feb90dda86bd25d7cca Mon Sep 17 00:00:00 2001 From: LiAn Date: Tue, 9 Aug 2022 01:33:58 +0000 Subject: [PATCH] update zh-cn/application-dev/ui/ui-ts-page-redirection-data-transmission.md. Signed-off-by: LiAn --- .../ui/ui-ts-page-redirection-data-transmission.md | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/zh-cn/application-dev/ui/ui-ts-page-redirection-data-transmission.md b/zh-cn/application-dev/ui/ui-ts-page-redirection-data-transmission.md index 95d0a31333..581b586411 100644 --- a/zh-cn/application-dev/ui/ui-ts-page-redirection-data-transmission.md +++ b/zh-cn/application-dev/ui/ui-ts-page-redirection-data-transmission.md @@ -49,7 +49,7 @@ 2. 点击FoodGridItem后跳转到FoodDetail页面。调用页面路由router模块的push接口,将FoodDetail页面推到路由栈中,实现页面跳转。使用router路由API接口,需要先引入router。 ```ts - import router from '@system.router' + import router from '@ohos.router' @Component struct FoodGridItem { @@ -61,7 +61,7 @@ .height(184) .width('100%') .onClick(() => { - router.push({ uri: 'pages/FoodDetail' }) + router.push({ url: 'pages/FoodDetail' }) }) } } @@ -72,7 +72,7 @@ 3. 在FoodDetail页面增加回到食物列表页面的图标。在resources > base > media文件夹下存入回退图标Back.png。新建自定义组件PageTitle,包含后退的图标和Food Detail的文本,调用路由的router.back()接口,弹出路由栈最上面的页面,即返回上一级页面。 ```ts // FoodDetail.ets - import router from '@system.router' + import router from '@ohos.router' @Component struct PageTitle { @@ -139,7 +139,7 @@ ```ts router.push({ - uri: 'pages/FoodDetail', + url: 'pages/FoodDetail', params: { foodData: this.foodItem } }) ``` -- GitLab