未验证 提交 0881863d 编写于 作者: O openharmony_ci 提交者: Gitee

!16228 翻译完成 15895+16115:【CustomDialog】增加showInSubWindow接口+CommonEvent error code

Merge pull request !16228 from ester.zhou/TR-15895
......@@ -86,8 +86,8 @@ For details about the error codes, see [Event Error Codes](../errorcodes/errorco
```ts
// Attributes of a common event.
let options = {
code: 0, // Initial code of the common event.
data: "initial data",// Initial data of the common event.
code: 0, // Result code of the common event.
data: "initial data",// Result data of the common event.
isOrdered: true // The common event is an ordered one.
}
......@@ -186,8 +186,8 @@ For details about the error codes, see [Event Error Codes](../errorcodes/errorco
```ts
// Attributes of a common event.
let options = {
code: 0, // Initial code of the common event.
data: "initial data",// Initial data of the common event.
code: 0, // Result code of the common event.
data: "initial data",// Result data of the common event.
}
// Callback for common event publication.
......@@ -224,7 +224,7 @@ Creates a subscriber. This API uses an asynchronous callback to return the resul
| Name | Type | Mandatory| Description |
| ------------- | ------------------------------------------------------------ | ---- | -------------------------- |
| subscribeInfo | [CommonEventSubscribeInfo](./js-apis-inner-commonEvent-commonEventSubscribeInfo.md) | Yes | Subscriber information. |
| subscribeInfo | [CommonEventSubscribeInfo](./js-apis-inner-commonEvent-commonEventSubscribeInfo.md) | Yes | Subscriber information. |
| callback | AsyncCallback\<[CommonEventSubscriber](./js-apis-inner-commonEvent-commonEventSubscriber.md)> | Yes | Callback used to return the result.|
**Example**
......@@ -270,7 +270,7 @@ Creates a subscriber. This API uses a promise to return the result.
| Name | Type | Mandatory| Description |
| ------------- | ----------------------------------------------------- | ---- | -------------- |
| subscribeInfo | [CommonEventSubscribeInfo](./js-apis-inner-commonEvent-commonEventSubscribeInfo.md) | Yes | Subscriber information.|
| subscribeInfo | [CommonEventSubscribeInfo](./js-apis-inner-commonEvent-commonEventSubscribeInfo.md) | Yes | Subscriber information.|
**Return value**
| Type | Description |
......@@ -327,7 +327,7 @@ let subscribeInfo = {
// Callback for common event subscription.
function SubscribeCB(err, data) {
if (err.code) {
if (err) {
console.error(`subscribe failed, code is ${err.code}, message is ${err.message}`);
} else {
console.info("subscribe ");
......
......@@ -11,7 +11,7 @@ A custom dialog box is a dialog box you customize by using APIs of the **CustomD
## APIs
CustomDialogController(value:{builder: CustomDialog, cancel?: () =&gt; void, autoCancel?: boolean, alignment?: DialogAlignment, offset?: Offset, customStyle?: boolean, gridCount?: number, maskColor?: ResourceColor, openAnimation?: AnimateParam, closeAniamtion?: AnimateParam})
CustomDialogController(value:{builder: CustomDialog, cancel?: () =&gt; void, autoCancel?: boolean, alignment?: DialogAlignment, offset?: Offset, customStyle?: boolean, gridCount?: number, maskColor?: ResourceColor, openAnimation?: AnimateParam, closeAniamtion?: AnimateParam, showInSubWindow?: boolean})
**Parameters**
......@@ -26,8 +26,9 @@ CustomDialogController(value:{builder: CustomDialog, cancel?: () =&gt; void, aut
| customStyle | boolean | No | Whether to use a custom style for the dialog box.<br>Default value: **false**, which means that the dialog box automatically adapts its width to the grid system and its height to the child components; the maximum height is 90% of the container height; the rounded corner is 24 vp. |
| gridCount<sup>8+</sup> | number | No | Number of [grid columns](../../ui/ui-ts-layout-grid-container-new.md) occupied by the dialog box.<br>The default value is 4, and the maximum value is the maximum number of columns supported by the system. If this parameter is set to an invalid value, the default value is used.|
| maskColor<sup>10+</sup> | [ResourceColor](ts-types.md#resourcecolor) | No | Custom mask color.<br>Default value: **0x33000000** |
| openAnimation<sup>10+</sup> | [AnimateParam](ts-explicit-animation.md#animateparam) | No | Parameters for defining the open animation of the dialog box. |
| openAnimation<sup>10+</sup> | [AnimateParam](ts-explicit-animation.md#animateparam) | No | Parameters for defining the open animation of the dialog box.<br>**NOTE**<br>If **iterations** is set to an odd number and **playMode** is set to **Reverse**, the dialog box will not be displayed when the animation ends. |
| closeAniamtion<sup>10+</sup>| [AnimateParam](ts-explicit-animation.md#animateparam) | No | Parameters for defining the close animation of the dialog box. |
| showInSubWindow<sup>10+</sup>| boolean | No | Whether to display a dialog box in a subwindow.<br>Default value: **false**, indicating that the dialog box is not displayed in the subwindow<br>**NOTE**<br>A dialog box whose **showInSubWindow** attribute is **true** cannot trigger the display of another dialog box whose **showInSubWindow** attribute is also **true**. |
## CustomDialogController
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册