Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
OpenHarmony
Docs
提交
e12c0e98
D
Docs
项目概览
OpenHarmony
/
Docs
大约 1 年 前同步成功
通知
159
Star
292
Fork
28
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
D
Docs
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
提交
e12c0e98
编写于
7月 28, 2022
作者:
W
wusongqing
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
update docs against 6623
Signed-off-by:
N
wusongqing
<
wusongqing@huawei.com
>
上级
84c47a10
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
20 addition
and
20 deletion
+20
-20
en/application-dev/reference/apis/js-apis-router.md
en/application-dev/reference/apis/js-apis-router.md
+20
-20
未找到文件。
en/application-dev/reference/apis/js-apis-router.md
浏览文件 @
e12c0e98
...
@@ -29,7 +29,7 @@ Navigates to a specified page in the application.
...
@@ -29,7 +29,7 @@ Navigates to a specified page in the application.
**Example**
**Example**
```
js
```
js
router
.
push
({
router
.
push
({
url
:
'
pages/routerpage2
'
,
url
:
'
pages/routerpage2
'
,
params
:
{
params
:
{
...
@@ -39,7 +39,7 @@ router.push({
...
@@ -39,7 +39,7 @@ router.push({
},
},
},
},
});
});
```
```
## router.push<sup>9+</sup>
## router.push<sup>9+</sup>
push(options: RouterOptions, mode: RouterMode): void
push(options: RouterOptions, mode: RouterMode): void
...
@@ -56,7 +56,7 @@ Navigates to a specified page in the application.
...
@@ -56,7 +56,7 @@ Navigates to a specified page in the application.
**Example**
**Example**
```
js
```
js
router
.
push
({
router
.
push
({
url
:
'
pages/routerpage2/routerpage2
'
,
url
:
'
pages/routerpage2/routerpage2
'
,
params
:
{
params
:
{
...
@@ -66,11 +66,11 @@ router.push({
...
@@ -66,11 +66,11 @@ router.push({
},
},
},
},
},
router
.
RouterMode
.
Standard
);
},
router
.
RouterMode
.
Standard
);
```
```
## router.replace
## router.replace
replace(options: RouterOptions
, mode?: RouterMode
): void
replace(options: RouterOptions): void
Replaces the current page with another one in the application and destroys the current page.
Replaces the current page with another one in the application and destroys the current page.
...
@@ -83,14 +83,14 @@ Replaces the current page with another one in the application and destroys the c
...
@@ -83,14 +83,14 @@ Replaces the current page with another one in the application and destroys the c
**Example**
**Example**
```
js
```
js
router
.
replace
({
router
.
replace
({
url
:
'
pages/detail
'
,
url
:
'
pages/detail
'
,
params
:
{
params
:
{
data1
:
'
message
'
,
data1
:
'
message
'
,
},
},
});
});
```
```
## router.replace
<sup>
9+
</sup>
## router.replace
<sup>
9+
</sup>
...
@@ -108,14 +108,14 @@ Replaces the current page with another one in the application and destroys the c
...
@@ -108,14 +108,14 @@ Replaces the current page with another one in the application and destroys the c
**Example**
**Example**
```
js
```
js
router
.
replace
({
router
.
replace
({
url
:
'
pages/detail/detail
'
,
url
:
'
pages/detail/detail
'
,
params
:
{
params
:
{
data1
:
'
message
'
,
data1
:
'
message
'
,
},
},
},
router
.
RouterMode
.
Standard
);
},
router
.
RouterMode
.
Standard
);
```
```
## router.back
## router.back
...
@@ -132,9 +132,9 @@ Returns to the previous page or a specified page.
...
@@ -132,9 +132,9 @@ Returns to the previous page or a specified page.
**Example**
**Example**
```
js
```
js
router
.
back
({
ur
i
:
'
pages/detail
'
});
router
.
back
({
ur
l
:
'
pages/detail
'
});
```
```
## router.clear
## router.clear
...
@@ -146,9 +146,9 @@ Clears all historical pages in the stack and retains only the current page at th
...
@@ -146,9 +146,9 @@ Clears all historical pages in the stack and retains only the current page at th
**Example**
**Example**
```
js
```
js
router
.
clear
();
router
.
clear
();
```
```
## router.getLength
## router.getLength
...
@@ -164,10 +164,10 @@ Obtains the number of pages in the current stack.
...
@@ -164,10 +164,10 @@ Obtains the number of pages in the current stack.
| string | Number of pages in the stack. The maximum value is
**32**
.|
| string | Number of pages in the stack. The maximum value is
**32**
.|
**Example**
**Example**
```
js
```
js
var
size
=
router
.
getLength
();
var
size
=
router
.
getLength
();
console
.
log
(
'
pages stack size =
'
+
size
);
console
.
log
(
'
pages stack size =
'
+
size
);
```
```
## router.getState
## router.getState
...
@@ -242,9 +242,9 @@ Disables the display of a confirm dialog box before returning to the previous pa
...
@@ -242,9 +242,9 @@ Disables the display of a confirm dialog box before returning to the previous pa
**System capability**
: SystemCapability.ArkUI.ArkUI.Full
**System capability**
: SystemCapability.ArkUI.ArkUI.Full
**Example**
**Example**
```
js
```
js
router
.
disableAlertBeforeBackPage
();
router
.
disableAlertBeforeBackPage
();
```
```
## router.getParams
## router.getParams
...
@@ -270,7 +270,7 @@ router.getParams();
...
@@ -270,7 +270,7 @@ router.getParams();
Describes the page routing options.
Describes the page routing options.
**System capability**
: SystemCapability.ArkUI.ArkUI.
Full
**System capability**
: SystemCapability.ArkUI.ArkUI.
Lite
| Name | Type | Mandatory| Description |
| Name | Type | Mandatory| Description |
| ------ | ------ | ---- | ------------------------------------------------------------ |
| ------ | ------ | ---- | ------------------------------------------------------------ |
...
@@ -314,7 +314,7 @@ export default {
...
@@ -314,7 +314,7 @@ export default {
// detail page
// detail page
export
default
{
export
default
{
onInit
()
{
onInit
()
{
console
.
info
(
'
showData1:
'
+
router
.
getParams
()
.
data1
);
console
.
info
(
'
showData1:
'
+
router
.
getParams
()
[
data1
]
);
}
}
}
}
```
```
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录