提交 e52732e7 编写于 作者: G Gloria

update docs against 9270

Signed-off-by: wusongqing<wusongqing@huawei.com>
上级 e5d98006
...@@ -21,28 +21,31 @@ Shows a toast. ...@@ -21,28 +21,31 @@ Shows a toast.
**System capability**: SystemCapability.ArkUI.ArkUI.Full **System capability**: SystemCapability.ArkUI.ArkUI.Full
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------- | ------------------------------------- | ---- | ------- | | ------- | ------------------------------------- | ---- | ------- |
| options | [ShowToastOptions](#showtoastoptions) | Yes | Toast options.| | options | [ShowToastOptions](#showtoastoptions) | Yes | Toast options.|
**Example** **Example**
```js
```js
prompt.showToast({ prompt.showToast({
message: 'Message Info', message: 'Message Info',
duration: 2000, duration: 2000,
}); });
``` ```
## ShowToastOptions ## ShowToastOptions
Describes the options for showing the toast. Describes the options for showing the toast.
**System capability**: SystemCapability.ArkUI.ArkUI.Full **System capability**: SystemCapability.ArkUI.ArkUI.Full
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ------ | ---------------------------------------- | | -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| message | string\| [Resource](.../ui/ts-types.md#resource-type)<sup>9+</sup>| Yes | Text to display. | | message | string\| [Resource](.../ui/ts-types.md#resource-type)<sup>9+</sup>| Yes | Text to display. |
| duration | number | No | Duration that the toast will remain on the screen. The default value is 1500 ms. The recommended value range is 1500 ms to 10000 ms. If a value less than 1500 ms is set, the default value is used.| | duration | number | No | Duration that the toast will remain on the screen. The default value is 1500 ms. The value range is 1500 ms to 10000 ms. If a value less than 1500 ms is set, the default value is used. If the value greater than 10000 ms is set, the upper limit 10000 ms is used.|
| bottom | string\| number | No | Distance between the toast border and the bottom of the screen. | | bottom | string\| number | No | Distance between the toast border and the bottom of the screen. |
## prompt.showDialog ## prompt.showDialog
...@@ -53,6 +56,7 @@ Shows a dialog box. This API uses a promise to return the result synchronously. ...@@ -53,6 +56,7 @@ Shows a dialog box. This API uses a promise to return the result synchronously.
**System capability**: SystemCapability.ArkUI.ArkUI.Full **System capability**: SystemCapability.ArkUI.ArkUI.Full
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------- | --------------------------------------- | ---- | ------ | | ------- | --------------------------------------- | ---- | ------ |
| options | [ShowDialogOptions](#showdialogoptions) | Yes | Dialog box options.| | options | [ShowDialogOptions](#showdialogoptions) | Yes | Dialog box options.|
...@@ -65,7 +69,7 @@ Shows a dialog box. This API uses a promise to return the result synchronously. ...@@ -65,7 +69,7 @@ Shows a dialog box. This API uses a promise to return the result synchronously.
**Example** **Example**
```js ```js
prompt.showDialog({ prompt.showDialog({
title: 'Title Info', title: 'Title Info',
message: 'Message Info', message: 'Message Info',
...@@ -86,7 +90,7 @@ prompt.showDialog({ ...@@ -86,7 +90,7 @@ prompt.showDialog({
.catch(err => { .catch(err => {
console.info('showDialog error: ' + err); console.info('showDialog error: ' + err);
}) })
``` ```
## prompt.showDialog ## prompt.showDialog
...@@ -96,15 +100,16 @@ Shows a dialog box. This API uses an asynchronous callback to return the result. ...@@ -96,15 +100,16 @@ Shows a dialog box. This API uses an asynchronous callback to return the result.
**System capability**: SystemCapability.ArkUI.ArkUI.Full **System capability**: SystemCapability.ArkUI.ArkUI.Full
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | ------------ | | -------- | ---------------------------------------- | ---- | ------------ |
| options | [ShowDialogOptions](#showdialogoptions) | Yes | Dialog box options.| | options | [ShowDialogOptions](#showdialogoptions) | Yes | Dialog box options.|
| callback | AsyncCallback&lt;[ShowDialogSuccessResponse](#showdialogsuccessresponse)&gt; | Yes | Callback used to return the dialog box response result. | | callback | AsyncCallback&lt;[ShowDialogSuccessResponse](#showdialogsuccessresponse)&gt; | Yes | Callback used to return the dialog box response result. |
**Example** **Example**
```js
```js
prompt.showDialog({ prompt.showDialog({
title: 'showDialog Title Info', title: 'showDialog Title Info',
message: 'Message Info', message: 'Message Info',
...@@ -125,7 +130,7 @@ prompt.showDialog({ ...@@ -125,7 +130,7 @@ prompt.showDialog({
} }
console.info('showDialog success callback, click button: ' + data.index); console.info('showDialog success callback, click button: ' + data.index);
}); });
``` ```
## ShowDialogOptions ## ShowDialogOptions
...@@ -159,6 +164,7 @@ Shows an action menu. This API uses a callback to return the result asynchronous ...@@ -159,6 +164,7 @@ Shows an action menu. This API uses a callback to return the result asynchronous
**System capability**: SystemCapability.ArkUI.ArkUI.Full **System capability**: SystemCapability.ArkUI.ArkUI.Full
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | --------- | | -------- | ---------------------------------------- | ---- | --------- |
| options | [ActionMenuOptions](#actionmenuoptions) | Yes | Action menu options. | | options | [ActionMenuOptions](#actionmenuoptions) | Yes | Action menu options. |
...@@ -166,7 +172,8 @@ Shows an action menu. This API uses a callback to return the result asynchronous ...@@ -166,7 +172,8 @@ Shows an action menu. This API uses a callback to return the result asynchronous
**Example** **Example**
```js
```js
prompt.showActionMenu({ prompt.showActionMenu({
title: 'Title Info', title: 'Title Info',
buttons: [ buttons: [
...@@ -186,7 +193,7 @@ prompt.showActionMenu({ ...@@ -186,7 +193,7 @@ prompt.showActionMenu({
} }
console.info('showActionMenu success callback, click button: ' + data.index); console.info('showActionMenu success callback, click button: ' + data.index);
}) })
``` ```
## prompt.showActionMenu ## prompt.showActionMenu
...@@ -197,17 +204,20 @@ Shows an action menu. This API uses a promise to return the result synchronously ...@@ -197,17 +204,20 @@ Shows an action menu. This API uses a promise to return the result synchronously
**System capability**: SystemCapability.ArkUI.ArkUI.Full **System capability**: SystemCapability.ArkUI.ArkUI.Full
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------- | --------------------------------------- | ---- | ------- | | ------- | --------------------------------------- | ---- | ------- |
| options | [ActionMenuOptions](#actionmenuoptions) | Yes | Action menu options.| | options | [ActionMenuOptions](#actionmenuoptions) | Yes | Action menu options.|
**Return value** **Return value**
| Type | Description | | Type | Description |
| ---------------------------------------- | ------- | | ---------------------------------------- | ------- |
| Promise&lt;[ActionMenuSuccessResponse](#actionmenusuccessresponse)&gt; | Promise used to return the action menu response result.| | Promise&lt;[ActionMenuSuccessResponse](#actionmenusuccessresponse)&gt; | Promise used to return the action menu response result.|
**Example** **Example**
```js
```js
prompt.showActionMenu({ prompt.showActionMenu({
title: 'showActionMenu Title Info', title: 'showActionMenu Title Info',
buttons: [ buttons: [
...@@ -227,7 +237,7 @@ prompt.showActionMenu({ ...@@ -227,7 +237,7 @@ prompt.showActionMenu({
.catch(err => { .catch(err => {
console.info('showActionMenu error: ' + err); console.info('showActionMenu error: ' + err);
}) })
``` ```
## ActionMenuOptions ## ActionMenuOptions
Describes the options for showing the action menu. Describes the options for showing the action menu.
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册