提交 e12c0e98 编写于 作者: W wusongqing

update docs against 6623

Signed-off-by: Nwusongqing <wusongqing@huawei.com>
上级 84c47a10
...@@ -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({uri:'pages/detail'}); router.back({url:'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.
先完成此消息的编辑!
想要评论请 注册