提交 0b26014c 编写于 作者: E esterzhou

update docs (12580)

Signed-off-by: Nesterzhou <ester.zhou@huawei.com>
上级 d510ad39
...@@ -7,26 +7,25 @@ The **\<XComponent>** can accept and display the EGL/OpenGL ES and media data in ...@@ -7,26 +7,25 @@ The **\<XComponent>** can accept and display the EGL/OpenGL ES and media data in
> 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.
## Child Components ## Child Components
Child components are not supported when **type** is set to **"surface"**.\ Child components are not supported when **type** is set to **"surface"**.
Since API version 9, child components are supported when **type** is set to **"component"**.
Since API version 9, child components are supported when **type** is set to **"component"**.
## APIs ## APIs
XComponent(value: {id: string, type: string, libraryname?: string, controller?: XComponentController}) XComponent(value: {id: string, type: string, libraryname?: string, controller?: XComponentController})
**Parameters** **Parameters**
| 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 the component is displayed individually, without being combined with that of other components. This option is used for displaying EGL/OpenGL ES and media data.<br>- **"component"**<sup>9+</sup>: The component becomes a container where non-UI logic can be executed to dynamically load the display content.| | type | string | Yes | Type of the component. The options are as follows:<br>- **"surface"**: The content of the component is displayed individually, without being combined with that of other components. This option is used for displaying EGL/OpenGL ES and media data.<br>- **"component"**<sup>9+</sup>: The component becomes a container where non-UI logic can be executed to dynamically load the display content.|
| libraryname | string | No | Name of the dynamic library generated after compilation at the application native layer. This parameter is valid only when the component type is **"surface"**.| | libraryname | string | No | Name of the dynamic library generated after compilation at the application native layer. This parameter is valid only when the component type is **"surface"**.|
| controller | [XComponentcontroller](#xcomponentcontroller) | No | Controller bound to the component, which can be used to invoke the methods of the component. This parameter is valid only when the component type is **"surface"**. | | controller | [XComponentcontroller](#xcomponentcontroller) | No | Controller bound to the component, which can be used to invoke methods of the component. This parameter is valid only when the component type is **"surface"**.|
> **NOTE**<br> > **NOTE**
> >
> When **type** is set to **"component"**, the **\<XComponent>** functions as a container, where child components are laid out vertically. > When **type** is set to **"component"**, the **\<XComponent>** functions as a container, where child components are laid out vertically.
> >
...@@ -46,7 +45,7 @@ The **\<XComponent>** can accept and display the EGL/OpenGL ES and media data in ...@@ -46,7 +45,7 @@ The **\<XComponent>** can accept and display the EGL/OpenGL ES and media data in
## Events ## Events
The following events are supported only when **type** is set to **"surface"**. The [universal events and gestures](./Readme-EN.md) are not supported. The following events are supported only when **type** is set to **"surface"**. The [universal events](ts-universal-events-click.md) and [universal gestures](ts-gesture-settings.md) are not supported.
### onLoad ### onLoad
...@@ -57,7 +56,7 @@ Triggered when the plug-in is loaded. ...@@ -57,7 +56,7 @@ Triggered when the plug-in is loaded.
**Parameters** **Parameters**
| Name | Type | Mandatory | Description | | Name | Type | Mandatory | Description |
| ------------- | ------ | ---- | ----------------------- | | ----- | ------ | ---- | ---------------------------------------- |
| event | object | No | Context of the **\<XComponent>** object. The APIs contained in the context are defined at the C++ layer by developers.| | event | object | No | Context of the **\<XComponent>** object. The APIs contained in the context are defined at the C++ layer by developers.|
### onDestroy ### onDestroy
......
...@@ -59,6 +59,6 @@ Application resources can be accessed via an absolute or relative path. In this ...@@ -59,6 +59,6 @@ Application resources can be accessed via an absolute or relative path. In this
## Configuration Files ## Configuration Files
If you are developing a widget in the FA model, configure the **config.json** file. For details, see [FA Widget Development](../../ability/fa-formability.md#configuring-the-widget-configuration-file). If you are developing a widget in the FA model, configure the **config.json** file.
If you are developing a widget in the stage model, configure **ExtensionAbility** under **extensionAbilities** in the **module.json5** file. For details, see [Stage Widget Development](../../ability/stage-formextension.md#configuring-the-widget-configuration-file). If you are developing a widget in the stage model, configure **ExtensionAbility** under **extensionAbilities** in the **module.json5** file.
...@@ -37,22 +37,22 @@ As shown above, the two development paradigms share the UI backend engine and la ...@@ -37,22 +37,22 @@ As shown above, the two development paradigms share the UI backend engine and la
## Relationship Between UI and Ability Framework ## Relationship Between UI and Ability Framework
Ability is an essential part of OpenHarmony applications. The [ability framework](../ability/ability-brief.md) provides two models: Feature Ability (FA) model and stage model. The table below describes the relationship between the two models of the ability framework and the two development paradigms of ArkUI. OpenHarmony provides two application models: FA model and stage model. The table below describes the relationship between these two models and the two development paradigms of ArkUI.
**FA Model** **FA Model**
| Type| UI Development Paradigm | Description| | Type | UI Development Paradigm | Description |
| -------- | --------------------------- | --------------------------- | | ---- | -------- | ---------------------------------------- |
| Application| Web-like development paradigm| UI development: HML, CSS, and JS<br>Service entries: files with fixed file names, which are **app.ets** (Page ability), **service.ts** (Service ability), and **data.ts** (Data ability)<br>Service logic: JS and TS| | Application | Web-like development paradigm| UI development: HML, CSS, and JS<br>Service entries: files with fixed file names, which are **app.ets** (Page ability), **service.ts** (Service ability), and **data.ts** (Data ability)<br>Service logic: JS and TS|
| | Declarative development paradigm| UI development: ArkTS<br>Service entries: files with fixed file names, which are **app.ets** (Page ability), **service.ts** (Service ability), and **data.ts** (Data ability)<br>Service logic: JS and TS| | | Declarative development paradigm | UI development: ArkTS<br>Service entries: files with fixed file names, which are **app.ets** (Page ability), **service.ts** (Service ability), and **data.ts** (Data ability)<br>Service logic: JS and TS|
| Service widget| Web-like development paradigm| UI development: HML, CSS, and JSON (action)<br>Service entry: **form.ts**<br>Service logic: JS and TS| | Service widget| Web-like development paradigm| UI development: HML, CSS, and JSON (action)<br>Service entry: **form.ts**<br>Service logic: JS and TS|
| | Declarative development paradigm| Not supported currently| | | Declarative development paradigm | Not supported currently |
**Stage Model** **Stage Model**
| Type| UI Development Paradigm | Description| | Type | UI Development Paradigm | Description |
| -------- | --------------------------- | --------------------------- | | ---- | -------- | ---------------------------------------- |
| Application| Web-like development paradigm| Not supported currently| | Application | Web-like development paradigm| Not supported currently |
| | Declarative development paradigm| UI development: ArkTS<br>Service entries: derived from **ohos.application.Ability**/**ExtensionAbility**<br>Service logic: TS| | | Declarative development paradigm | UI development: ArkTS<br>Service entries: derived from **ohos.application.Ability**/**ExtensionAbility**<br>Service logic: TS|
| Service widget| Web-like development paradigm| UI development: HML, CSS, and JSON (action)<br>Service entries: derived from **FormExtensionAbility**<br>Service logic: TS| | Service widget| Web-like development paradigm| UI development: HML, CSS, and JSON (action)<br>Service entries: derived from **FormExtensionAbility**<br>Service logic: TS|
| | Declarative development paradigm| Not supported currently| | | Declarative development paradigm | Not supported currently |
...@@ -9,7 +9,7 @@ You only need to perform operations in [Resource Files](#resource-files) and [Re ...@@ -9,7 +9,7 @@ You only need to perform operations in [Resource Files](#resource-files) and [Re
## Resource Files ## Resource Files
Resource files store application content in multiple languages. This framework uses JSON files to store resource definitions. Place the resource file of each locale in the i18n directory described in [File Organization](../ui/js-framework-file.md). Resource files store application content in multiple languages. This framework uses JSON files to store resource definitions. Place the resource file of each locale in the i18n directory described in [File Organization](js-framework-file.md).
Resource files should be named in _language-script-region_.json format. For example, the resource file for Hong Kong(China) in the traditional script is named zh-Hant-HK. You can omit the region, for example, zh-CN for simplified Chinese, or omit both the script and region, for example, zh for Chinese. Resource files should be named in _language-script-region_.json format. For example, the resource file for Hong Kong(China) in the traditional script is named zh-Hant-HK. You can omit the region, for example, zh-CN for simplified Chinese, or omit both the script and region, for example, zh for Chinese.
...@@ -191,4 +191,4 @@ Table 3 $t function parameters ...@@ -191,4 +191,4 @@ Table 3 $t function parameters
## Language Acquisition ## Language Acquisition
For details about how to obtain the language, see [Configuration](../reference/apis/js-apis-configuration.md). For details about how to obtain the language, see [Configuration](../reference/apis/js-apis-application-configuration.md).
\ No newline at end of file
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册