未验证 提交 3d5ee195 编写于 作者: K king_he 提交者: Gitee

update en/application-dev/reference/arkui-ts/ts-basic-components-xcomponent.md.

Signed-off-by: Nking_he <6384784@qq.com>
上级 2eeaaf12
# XComponent # XComponent
> ![icon-note.gif](public_sys-resources/icon-note.gif) **NOTE** > **NOTE**<br>
> This component is supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version. > This component is supported since API version 8. Updates will be marked with a superscript to indicate their earliest API version.
The **\<XComponent>** can accept and display the EGL/OpenGLES and media data input. The **\<XComponent>** can accept and display the EGL/OpenGLES and media data input.
...@@ -19,20 +19,20 @@ ...@@ -19,20 +19,20 @@
- Name - Name
| Name | Type | Mandatory| Description | | Name | Type | Mandatory | Description |
| ----------- | --------------------------------------------- | ---- | ------------------------------------------------------------ | | ----------- | --------------------------------------- | --------- | ------------------------------------------------------------ |
| id | string | Yes | Unique ID of the component. The value can contain a maximum of 128 characters. | | id | string | Yes | Unique ID of the component. The value can contain a maximum of 128 characters. |
| type | string | Yes | Type of the component. The options are as follows:<br>-**surface**: The content of this component is displayed individually, without being combined with that of other components.<br>-**component**: The content of this component is displayed after having been combined with that of other components.<br>This API is defined but not implemented in OpenHarmony 3.1 Release. It will be available for use in OpenHarmony 3.1 MR.| | type | string | Yes | Type of the component. The options are as follows:<br>-**surface**: The content of this component is displayed individually, without being combined with that of other components.<br>-**component**: The content of this component is displayed after having been combined with that of other components.<br>This API is defined but not implemented in OpenHarmony 3.1 Release. It will be available for use in OpenHarmony 3.1 MR.|
| libraryname | string | No | Name of the dynamic library generated after compilation at the application native layer. | | libraryname | string | No | Name of the dynamic library generated after compilation at the application native layer. |
| controller | [XComponentController](#XComponentController) | No | Controller bound to the component, which can be used to invoke methods of the component. | | controller | [XComponentController](#XComponentController) | No | Controller bound to the component, which can be used to invoke methods of the component. |
## Events ## Events
| Name | Description | | Name | Description |
| ------------------------------- | ------------------------ | | ------------------------------- | ------------------------ |
| onLoad(context?: object) => void | Triggered when the plug-in is loaded.| | onLoad(context?: object) => void | Triggered when the plug-in is loaded. |
| onDestroy() => void | Triggered when the plug-in is destroyed.| | onDestroy() => void | Triggered when the plug-in is destroyed. |
## XComponentController ## XComponentController
...@@ -52,9 +52,9 @@ Obtains the ID of the surface held by the **\<XComponent>**. The ID can be used ...@@ -52,9 +52,9 @@ Obtains the ID of the surface held by the **\<XComponent>**. The ID can be used
- Return value - Return value
| Type | Description | | Type | Description |
| ------ | --------------------------- | | ------ | --------------------------- |
| string | ID of the surface held by the **\<XComponent>**.| | string | ID of the surface held by the **\<XComponent>**. |
### setXComponentSurfaceSize ### setXComponentSurfaceSize
...@@ -64,10 +64,10 @@ Sets the width and height of the surface held by the **\<XComponent>**. ...@@ -64,10 +64,10 @@ Sets the width and height of the surface held by the **\<XComponent>**.
- Parameters - Parameters
| Name | Type| Mandatory| Default Value| Description | | Name | Type | Mandatory | Default Value | Description |
| ------------- | -------- | ---- | ------ | ----------------------------- | | ------------- | -------- | ---- | ------ | ----------------------------- |
| surfaceWidth | number | Yes | - | Width of the surface held by the **\<XComponent>**.| | surfaceWidth | number | Yes | - | Width of the surface held by the **\<XComponent>**. |
| surfaceHeight | number | Yes | - | Height of the surface held by the **\<XComponent>**.| | surfaceHeight | number | Yes | - | Height of the surface held by the **\<XComponent>**. |
### getXComponentContext ### getXComponentContext
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册