提交 3ebe9880 编写于 作者: E ester.zhou

Update docs (15814)

Signed-off-by: Nester.zhou <ester.zhou@huawei.com>
上级 e61e8b2f
......@@ -45,11 +45,11 @@ Describes the options for showing the toast.
**System capability**: SystemCapability.ArkUI.ArkUI.Full
| Name | Type | Mandatory | Description |
| -------- | ---------------------------------------- | ---- | ---------------------------------------- |
| message | string \| [Resource](../arkui-ts/ts-types.md#resource)<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 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. It does not have an upper limit. The default unit is vp. |
| Name | Type | Mandatory| Description |
| -------- | --------------- | ---- | ------------------------------------------------------------ |
| message | string | Yes | Text to display. |
| 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. It does not have an upper limit. The default unit is vp. |
## prompt.showDialog
......@@ -146,11 +146,11 @@ Describes the options for showing the dialog box.
**System capability**: SystemCapability.ArkUI.ArkUI.Full
| Name | Type | Mandatory| Description |
| ------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| title | string \| [Resource](../arkui-ts/ts-types.md#resource)<sup>9+</sup> | No | Title of the dialog box. |
| message | string \| [Resource](../arkui-ts/ts-types.md#resource)<sup>9+</sup> | No | Text body. |
| buttons | [[Button](#button),[Button](#button)?,[Button](#button)?] | No | Array of buttons in the dialog box. The array structure is **{text:'button', color: '\#666666'}**. Up to three buttons are supported. The first button is of the **positiveButton** type, the second is of the **negativeButton** type, and the third is of the **neutralButton** type.|
| Name | Type | Mandatory| Description |
| ------- | --------------------------------------------------------- | ---- | ------------------------------------------------------------ |
| title | string | No | Title of the dialog box. |
| message | string | No | Text body. |
| buttons | [[Button](#button),[Button](#button)?,[Button](#button)?] | No | Array of buttons in the dialog box. The array structure is **{text:'button', color: '\#666666'}**. Up to three buttons are supported. The first button is of the **positiveButton** type, the second is of the **negativeButton** type, and the third is of the **neutralButton** type.|
## ShowDialogSuccessResponse
......@@ -257,7 +257,7 @@ Describes the options for showing the action menu.
| Name | Type | Mandatory| Description |
| ------- | ------------------------------------------------------------ | ---- | ------------------------------------------------------------ |
| title | string \| [Resource](../arkui-ts/ts-types.md#resource)<sup>9+</sup> | No | Title of the text to display. |
| title | string | No | Title of the text to display. |
| buttons | [[Button](#button),[Button](#button)?,[Button](#button)?,[Button](#button)?,[Button](#button)?,[Button](#button)?] | Yes | Array of menu item buttons. The array structure is **{text:'button', color: '\#666666'}**. Up to six buttons are supported. If there are more than six buttons, extra buttons will not be displayed.|
## ActionMenuSuccessResponse
......@@ -276,7 +276,7 @@ Describes the menu item button in the action menu.
**System capability**: SystemCapability.ArkUI.ArkUI.Full
| Name | Type | Mandatory | Description |
| ----- | ---------------------------------------- | ---- | ------- |
| text | string \| [Resource](../arkui-ts/ts-types.md#resource)<sup>9+</sup> | Yes | Button text.|
| color | string \| [Resource](../arkui-ts/ts-types.md#resource)<sup>9+</sup> | Yes | Text color of the button.|
| Name | Type | Mandatory| Description |
| ----- | ------ | ---- | -------------- |
| text | string | Yes | Button text.|
| color | string | Yes | Text color of the button.|
......@@ -362,7 +362,7 @@ 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. |
| 100001 | if can not get the delegate, only throw in standard system. |
| 200002 | if the uri is not exist. |
**Example**
......@@ -598,7 +598,7 @@ export default {
// detail page
export default {
onInit() {
console.info('showData1:' + router.getParams()[data1]);
console.info('showData1:' + router.getParams()['data1']);
}
}
```
......
......@@ -3,7 +3,7 @@
Custom components are existing components encapsulated based on service requirements. A custom component can be invoked multiple times in a project to improve the code readability. You can import a custom component to the host page through **element** as shown in the following code snippet:
```html
<element name='comp' src='../../common/component/comp.hml'></element>
<element name='comp' src='../common/component/comp.hml'></element>
<div>
<comp prop1='xxxx' @child1="bindParentVmMethod"></comp>
</div>
......@@ -12,8 +12,8 @@ Custom components are existing components encapsulated based on service requirem
The following is an example of using a custom component with **if-else**, which displays **comp1** when **showComp1** is set to **true** and displays **comp2** otherwise.
```html
<element name='comp1' src='../../common/component/comp1/comp1.hml'></element>
<element name='comp2' src='../../common/component/comp2/comp2.hml'></element>
<element name='comp1' src='../common/component/comp1/comp1.hml'></element>
<element name='comp2' src='../common/component/comp2/comp2.hml'></element>
<div>
<comp1 if="{{showComp1}}" prop1='xxxx' @child1="bindParentVmMethodOne"></comp1>
<comp2 else prop1='xxxx' @child1="bindParentVmMethodTwo"></comp2>
......@@ -76,7 +76,7 @@ The following example describes how to import **comp** to the parent component:
```html
<!-- xxx.hml -->
<element name='comp' src='../../common/component/comp.hml'></element>
<element name='comp' src='../common/component/comp.hml'></element>
<div class="container">
<comp @event-type1="textClicked"></comp>
</div>
......@@ -125,7 +125,7 @@ In the following example, the child component passes the **text** parameter to t
```html
<!-- xxx.hml -->
<element name='comp' src='../../common/comp/comp.hml'></element>
<element name='comp' src='../common/comp/comp.hml'></element>
<div class="container">
<text>Parent component: {{text}}</text>
<comp @event-type1="textClicked"></comp>
......
......@@ -21,7 +21,7 @@ export default {
```html
<!-- xxx.hml -->
<element name='comp' src='../../common/component/comp/comp.hml'></element>
<element name='comp' src='../common/component/comp/comp.hml'></element>
<div class="container">
<comp comp-prop="{{title}}"></comp>
</div>
......@@ -57,7 +57,7 @@ In this example, a **\<text>** component is added to display the title. The titl
```html
<!-- xxx.hml -->
<element name='comp' src='../../common/component/comp/comp.hml'></element>
<element name='comp' src='../common/component/comp/comp.hml'></element>
<div class="container">
<comp title="Custom component"></comp>
</div>
......
......@@ -20,7 +20,7 @@ You can use the **\<slot>** tag to create a slot inside a custom component to fi
The following references the custom component:
```html
<!-- xxx.hml -->
<element name='comp' src='../../common/component/comp.hml'></element>
<element name='comp' src='../common/component/comp.hml'></element>
<div class="container">
<comp>
<text class="text-style">Content defined in the parent component</text>
......@@ -45,7 +45,7 @@ When multiple slots are need inside a custom component, you can name them, so th
The following references the custom component:
```html
<!-- xxx.hml -->
<element name='comp' src='../../common/component/comp.hml'></element>
<element name='comp' src='../common/component/comp.hml'></element>
<div class="container">
<comp>
<text class="text-style" slot="second">Fill in the second slot.</text>
......
......@@ -42,7 +42,7 @@ Creates a **FormComponent** instance to display the provided widget.
| Name | Type | Mandatory| Description |
| --------- | ------------------------------- | ---- | ----------------------------------------------------------------------- |
| id | number | Yes | Widget ID. Set this parameter to **0** for a new widget. |
| id | number | Yes | Widget ID. Set this parameter to **0** for a new widget. |
| name | string | Yes | Widget name. |
| bundle | string | Yes | Bundle name of the widget. |
| ability | string | Yes | Ability name of the widget. |
......@@ -63,7 +63,7 @@ Creates a **FormComponent** instance to display the provided widget.
## Attributes
| Name | Type | Mandatory| Description |
| ----------- | ----------------------------------------------------------------------------------------------------- | ---- | ----------------------------------------------------------------------- |
| size | {<br>width?:&nbsp;[Length](ts-types.md#length),<br>height?:&nbsp;[Length](ts-types.md#length)<br>} | Yes | Size of the widget. |
| size | {<br>width?: [Length](ts-types.md#length),<br>height?: [Length](ts-types.md#length)<br>} | Yes | Size of the widget. |
| moduleName | string | Yes | Module name of the widget. |
| dimension | [FormDimension](#formdimension) | No | Dimensions of the widget. The widgets in the 2 x 2, 4 x 4, and 4 x 2 dimensions are supported.<br>Default value: **Dimension_2_2**|
| allowUpdate | boolean | No | Whether to allow the widget to update.<br>Default value: **true** |
......@@ -75,10 +75,10 @@ Creates a **FormComponent** instance to display the provided widget.
| Name | Description |
| ------------------------------------------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------- |
| onAcquired(callback:&nbsp;(info:&nbsp;{&nbsp;id:&nbsp;number&nbsp;})&nbsp;=&gt;&nbsp;void) | Triggered when a widget is obtained. This API returns the ID of the obtained widget. |
| onError(callback:&nbsp;(info:&nbsp;{&nbsp;errcode:&nbsp;number,&nbsp;msg:&nbsp;string&nbsp;})&nbsp;=&gt;&nbsp;void) | Triggered when an error occurs during component loading.<br>**errcode**: error code.<br>**msg**: error information. |
| onRouter(callback:&nbsp;(info:&nbsp;any)&nbsp;=&gt;&nbsp;void) | Triggered when routing occurs for the widget. This API returns information in [routerEvent](../js-service-widget-ui/js-service-widget-syntax-hml.md#event-binding).|
| onUninstall(callback:&nbsp;(info:&nbsp;{&nbsp;id:&nbsp;number&nbsp;})&nbsp;=&gt;&nbsp;void) | Triggered when a widget is uninstalled. This API returns the ID of the uninstalled widget. |
| onAcquired(callback: (info: { id: number }) =&gt; void) | Triggered when a widget is obtained. This API returns the ID of the obtained widget. |
| onError(callback: (info: { errcode: number, msg: string }) =&gt; void) | Triggered when an error occurs during component loading.<br>**errcode**: error code.<br>**msg**: error information. |
| onRouter(callback: (info: any) =&gt; void) | Triggered when routing occurs for the widget. This API returns information in [routerEvent](../js-service-widget-ui/js-service-widget-syntax-hml.md#event-binding).|
| onUninstall(callback: (info: { id: number }) =&gt; void) | Triggered when a widget is uninstalled. This API returns the ID of the uninstalled widget. |
## Example
......@@ -108,7 +108,7 @@ struct CardExample {
.visibility(Visibility.Visible)
.onAcquired((form)=>{
console.log(`form info : ${JSON.stringify(form)}`);
this.fomId = form.id;
this.formId = form.id;
})
.onError((err)=>{
console.log(`fail to add form, err: ${JSON.stringify(err)}`);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册