> - The initial APIs of this module are supported since API version 8. Newly added APIs will be marked with a superscript to indicate their earliest API version.
> - Page routing APIs can be invoked only after page rendering is complete. Do not call the APIs in **onInit** and **onReady** when the page is still in the rendering phase.
...
...
@@ -24,13 +24,13 @@ Navigates to a specified page in the application.
| options | [RouterOptions](#routeroptions) | Yes| Description of the page. The **url** parameter indicates the URL of the page to return to. If the specified page does not exist in the page stack, the application does not respond. If this parameter is not set, the application returns to the previous page.|
| Name| Type| Mandatory| Description|
| -------- | -------- | -------- | -------- |
| options | [RouterOptions](#routeroptions) | Yes| Description of the page. The **url** parameter indicates the URL of the page to return to. If the specified page does not exist in the page stack, the application does not respond. If this parameter is not set, the application returns to the previous page.|
**Example**
```
```js
// index page
exportdefault{
indexPushPage(){
...
...
@@ -128,7 +129,7 @@ Returns to the previous page or a specified page.
}
```
```
```js
// detail page
exportdefault{
detailPushPage(){
...
...
@@ -139,7 +140,7 @@ Returns to the previous page or a specified page.
}
```
```
```js
// Navigate from the mall page to the detail page through router.back().
exportdefault{
mallBackPage(){
...
...
@@ -148,7 +149,7 @@ Returns to the previous page or a specified page.
}
```
```
```js
// Navigate from the detail page to the index page through router.back().
exportdefault{
defaultBack(){
...
...
@@ -157,7 +158,7 @@ Returns to the previous page or a specified page.
}
```
```
```js
// Return to the detail page through router.back().
exportdefault{
backToDetail(){
...
...
@@ -175,12 +176,12 @@ Clears all historical pages in the stack and retains only the current page at th
| index | number | Index of the current page in the stack.<br>> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br>> The index starts from 1 from the bottom to the top of the stack.|
| name | string | Name of the current page, that is, the file name.|
| path | string | Path of the current page.|
| Name| Type| Description|
| -------- | -------- | -------- |
| index | number | Index of the current page in the stack.<br>> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE**<br>> The index starts from 1 from the bottom to the top of the stack.|
| name | string | Name of the current page, that is, the file name.|
| path | string | Path of the current page.|
**Example**
```
```js
exportdefault{
getState(){
varpage=router.getState();
...
...
@@ -249,13 +250,13 @@ Enables the display of a confirm dialog box before returning to the previous pag
> - The APIs of this module are no longer maintained since API version 7. You are advised to use the new APIs.
>
> - The initial APIs of this module are supported since API version 3. Newly added APIs will be marked with a superscript to indicate their earliest API version.
...
...
@@ -138,7 +138,8 @@ Sets the maximum size (in bytes) of the image data cached in the memory before d
export default {
onCreate() {
app.setImageRawDataCacheSize(100) // Set the upper limit of the memory for caching image data before decoding to 100 MB.
app.setImageRawDataCacheSize(104857600)
// Set the upper limit of the memory for caching image data before decoding to 100 MB. (100 x 1024 x 1024 B =104857600 B = 100 MB).
console.info('Application onCreate')
},
onDestroy() {
...
...
@@ -168,7 +169,8 @@ Sets the maximum size of the image file cache (in bytes) to speed up the loading
export default {
onCreate() {
app.setImageFileCacheSize(200) // Set the upper limit of the image file cache to 200 MB.
app.setImageFileCacheSize(209715200)
// Set the upper limit of the image file cache to 200 MB. (200 x 1024 x 1024 B= 209715200 B = 200 MB).