> - 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.
> - 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.
> - 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.
...
@@ -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.|
| 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**
**Example**
```
```js
// index page
// index page
exportdefault{
exportdefault{
indexPushPage(){
indexPushPage(){
...
@@ -128,7 +129,7 @@ Returns to the previous page or a specified page.
...
@@ -128,7 +129,7 @@ Returns to the previous page or a specified page.
}
}
```
```
```
```js
// detail page
// detail page
exportdefault{
exportdefault{
detailPushPage(){
detailPushPage(){
...
@@ -139,7 +140,7 @@ Returns to the previous page or a specified page.
...
@@ -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().
// Navigate from the mall page to the detail page through router.back().
exportdefault{
exportdefault{
mallBackPage(){
mallBackPage(){
...
@@ -148,7 +149,7 @@ Returns to the previous page or a specified page.
...
@@ -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().
// Navigate from the detail page to the index page through router.back().
exportdefault{
exportdefault{
defaultBack(){
defaultBack(){
...
@@ -157,7 +158,7 @@ Returns to the previous page or a specified page.
...
@@ -157,7 +158,7 @@ Returns to the previous page or a specified page.
}
}
```
```
```
```js
// Return to the detail page through router.back().
// Return to the detail page through router.back().
exportdefault{
exportdefault{
backToDetail(){
backToDetail(){
...
@@ -175,12 +176,12 @@ Clears all historical pages in the stack and retains only the current page at th
...
@@ -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>>  **NOTE**<br>> The index starts from 1 from the bottom to the top of the stack.|
| index | number | Index of the current page in the stack.<br>>  **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.|
| name | string | Name of the current page, that is, the file name.|
| path | string | Path of the current page.|
| path | string | Path of the current page.|
**Example**
**Example**
```
```js
exportdefault{
exportdefault{
getState(){
getState(){
varpage=router.getState();
varpage=router.getState();
...
@@ -249,13 +250,13 @@ Enables the display of a confirm dialog box before returning to the previous pag
...
@@ -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 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.
> - 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
...
@@ -138,7 +138,8 @@ Sets the maximum size (in bytes) of the image data cached in the memory before d
export default {
export default {
onCreate() {
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')
console.info('Application onCreate')
},
},
onDestroy() {
onDestroy() {
...
@@ -168,7 +169,8 @@ Sets the maximum size of the image file cache (in bytes) to speed up the loading
...
@@ -168,7 +169,8 @@ Sets the maximum size of the image file cache (in bytes) to speed up the loading
export default {
export default {
onCreate() {
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).