The **animator** module provides APIs for applying animation effects, including defining animations, starting animations, and playing animations in reverse order.
The **Animator** module provides APIs for applying animation effects, including defining animations, starting animations, and playing animations in reverse order.
> **NOTE**
>
...
...
@@ -72,7 +72,7 @@ For details about the error codes, see [Animator Error Codes](../errorcodes/erro
| ID | Error Message|
| --------- | ------- |
| 100001 | If no page is found for pageId or fail to get object property list. |
| 100001 | if no page is found for pageId or fail to get object property list. |
The **Router** module provides APIs to access pages through URLs. You can use the APIs to navigate to a specified page in an application, replace the current page with another one in an application, and return to the previous page or a specified page.
...
...
@@ -40,15 +40,14 @@ For details about the error codes, see [Router Error Codes](../errorcodes/errorc
| ID | Error Message|
| --------- | ------- |
| 100001 | If UI execution context not found. |
| 100002 | If the uri is not exist. |
| 100003 | If the pages are pushed too much. |
| 100001 | if UI execution context not found. |
| 100002 | if the uri is not exist. |
| 100003 | if the pages are pushed too much. |
**Example**
```js
try{
router.pushUrl({
router.pushUrl({
url:'pages/routerpage2',
params:{
data1:'message',
...
...
@@ -56,16 +55,13 @@ try {
data3:[123,456,789]
}
}
})
})
.then(()=>{
// success
})
.catch(err=>{
console.error(`pushUrl failed, code is ${err.code}, message is ${err.message}`);
})
}catch(error){
console.error(`pushUrl args error code is ${error.code}, message is ${error.message}`);
};
```
## router.pushUrl<sup>9+</sup>
...
...
@@ -89,15 +85,14 @@ For details about the error codes, see [Router Error Codes](../errorcodes/errorc
| ID | Error Message|
| --------- | ------- |
| 100001 | If UI execution context not found. |
| 100002 | If the uri is not exist. |
| 100003 | If the pages are pushed too much. |
| 100001 | if UI execution context not found. |
| 100002 | if the uri is not exist. |
| 100003 | if the pages are pushed too much. |
**Example**
```js
try{
router.pushUrl({
router.pushUrl({
url:'pages/routerpage2',
params:{
data1:'message',
...
...
@@ -105,16 +100,13 @@ try {
data3:[123,456,789]
}
}
},(err)=>{
},(err)=>{
if(err){
console.error(`pushUrl failed, code is ${err.code}, message is ${err.message}`);
return;
}
console.info('pushUrl success');
});
}catch(error){
console.error(`pushUrl args error code is ${error.code}, message is ${error.message}`);
};
});
```
## router.pushUrl<sup>9+</sup>
...
...
@@ -143,15 +135,14 @@ For details about the error codes, see [Router Error Codes](../errorcodes/errorc
| ID | Error Message|
| --------- | ------- |
| 100001 | If UI execution context not found. |
| 100002 | If the uri is not exist. |
| 100003 | If the pages are pushed too much. |
| 100001 | if UI execution context not found. |
| 100002 | if the uri is not exist. |
| 100003 | if the pages are pushed too much. |
**Example**
```js
try{
router.pushUrl({
router.pushUrl({
url:'pages/routerpage2',
params:{
data1:'message',
...
...
@@ -159,16 +150,13 @@ try {
data3:[123,456,789]
}
}
},router.RouterMode.Standard)
},router.RouterMode.Standard)
.then(()=>{
// success
})
.catch(err=>{
console.error(`pushUrl failed, code is ${err.code}, message is ${err.message}`);
})
}catch(error){
console.error(`pushUrl args error code is ${error.code}, message is ${error.message}`);
};
```
## router.pushUrl<sup>9+</sup>
...
...
@@ -193,15 +181,14 @@ For details about the error codes, see [Router Error Codes](../errorcodes/errorc
| ID | Error Message|
| --------- | ------- |
| 100001 | If UI execution context not found. |
| 100002 | If the uri is not exist. |
| 100003 | If the pages are pushed too much. |
| 100001 | if UI execution context not found. |
| 100002 | if the uri is not exist. |
| 100003 | if the pages are pushed too much. |
**Example**
```js
try{
router.pushUrl({
router.pushUrl({
url:'pages/routerpage2',
params:{
data1:'message',
...
...
@@ -209,16 +196,13 @@ try {
data3:[123,456,789]
}
}
},router.RouterMode.Standard,(err)=>{
},router.RouterMode.Standard,(err)=>{
if(err){
console.error(`pushUrl failed, code is ${err.code}, message is ${err.message}`);
return;
}
console.info('pushUrl success');
});
}catch(error){
console.error(`pushUrl args error code is ${error.code}, message is ${error.message}`);
};
});
```
## router.replaceUrl<sup>9+</sup>
...
...
@@ -247,28 +231,24 @@ For details about the error codes, see [Router Error Codes](../errorcodes/errorc
| ID | Error Message|
| --------- | ------- |
| 100001 | If UI execution context not found, only throw in standard system. |
| 200002 | If the uri is not exist. |
| 100001 | if UI execution context not found, only throw in standard system. |
| 200002 | if the uri is not exist. |
**Example**
```js
try{
router.replaceUrl({
router.replaceUrl({
url:'pages/detail',
params:{
data1:'message'
}
})
})
.then(()=>{
// success
})
.catch(err=>{
console.error(`replaceUrl failed, code is ${err.code}, message is ${err.message}`);
})
}catch(error){
console.error(`replaceUrl args error code is ${error.code}, message is ${error.message}`);
};
```
## router.replaceUrl<sup>9+</sup>
...
...
@@ -292,28 +272,24 @@ For details about the error codes, see [Router Error Codes](../errorcodes/errorc
| ID | Error Message|
| --------- | ------- |
| 100001 | If UI execution context not found, only throw in standard system. |
| 200002 | If the uri is not exist. |
| 100001 | if UI execution context not found, only throw in standard system. |
| 200002 | if the uri is not exist. |
**Example**
```js
try{
router.replaceUrl({
router.replaceUrl({
url:'pages/detail',
params:{
data1:'message'
}
},(err)=>{
},(err)=>{
if(err){
console.error(`replaceUrl failed, code is ${err.code}, message is ${err.message}`);
return;
}
console.info('replaceUrl success');
});
}catch(error){
console.error(`replaceUrl args error code is ${error.code}, message is ${error.message}`);
};
});
```
## router.replaceUrl<sup>9+</sup>
...
...
@@ -344,28 +320,24 @@ For details about the error codes, see [Router Error Codes](../errorcodes/errorc
| ID | Error Message|
| --------- | ------- |
| 100001 | If UI execution context not found, only throw in standard system. |
| 200002 | If the uri is not exist. |
| 100001 | if UI execution context not found, only throw in standard system. |
| 200002 | if the uri is not exist. |
**Example**
```js
try{
router.replaceUrl({
router.replaceUrl({
url:'pages/detail',
params:{
data1:'message'
}
},router.RouterMode.Standard)
},router.RouterMode.Standard)
.then(()=>{
// success
})
.catch(err=>{
console.error(`replaceUrl failed, code is ${err.code}, message is ${err.message}`);
})
}catch(error){
console.error(`replaceUrl args error code is ${error.code}, message is ${error.message}`);
};
```
## router.replaceUrl<sup>9+</sup>
...
...
@@ -390,28 +362,24 @@ For details about the error codes, see [Router Error Codes](../errorcodes/errorc
| ID | Error Message|
| --------- | ------- |
| 100001 | If UI execution context not found, only throw in standard system. |
| 200002 | If the uri is not exist. |
| 100001 | if UI execution context not found, only throw in standard system. |
| 200002 | if the uri is not exist. |
**Example**
```js
try{
router.replaceUrl({
router.replaceUrl({
url:'pages/detail',
params:{
data1:'message'
}
},router.RouterMode.Standard,(err)=>{
},router.RouterMode.Standard,(err)=>{
if(err){
console.error(`replaceUrl failed, code is ${err.code}, message is ${err.message}`);
return;
}
console.info('replaceUrl success');
});
}catch(error){
console.error(`replaceUrl args error code is ${error.code}, message is ${error.message}`);
};
});
```
## router.back
...
...
@@ -524,7 +492,7 @@ For details about the error codes, see [Router Error Codes](../errorcodes/errorc
| ID | Error Message|
| --------- | ------- |
| 100001 | If UI execution context not found. |
| 100001 | if UI execution context not found. |
**Example**
...
...
@@ -572,8 +540,8 @@ Obtains the parameters passed from the page that initiates redirection to the cu
**Return value**
| Type | Description |
| ------ | ----------------- |
| Object | Parameters passed from the page that initiates redirection to the current page.|
| ------ | ---------------------------------- |
| object | Parameters passed from the page that initiates redirection to the current page.|
**Example**
...
...
@@ -594,6 +562,7 @@ Describes the page routing options.
> **NOTE**
>
> The page routing stack supports a maximum of 32 pages.
## RouterMode<sup>9+</sup>
...
...
@@ -636,7 +605,7 @@ export default {
### TypeScript-based Declarative Development Paradigm
```ts
// Navigate to the target page through router.push with the params parameter carried.
// Navigate to the target page through router.pushUrl with the params parameter carried.