• Home
Name Date Size #Lines LOC

..--

adapter/12-May-2024-51,90641,399

advanced_ui_component/12-May-2024-41,67838,384

build/12-May-2024-979772

figures/12-May-2024-

frameworks/12-May-2024-1,186,289943,148

interfaces/12-May-2024-31,79321,632

test/12-May-2024-282,678174,670

.clang-formatD12-May-20243.1 KiB110109

.gitattributesD12-May-2024631 1615

.gitignoreD12-May-2024192 1716

BUILD.gnD12-May-20243.8 KiB150128

LICENSED12-May-20249.9 KiB177150

OAT.xmlD12-May-202413.1 KiB13278

README.mdD12-May-20245.3 KiB10471

README_zh.mdD12-May-20242.3 KiB4729

ace_config.gniD12-May-20248.3 KiB277232

bundle.jsonD12-May-20247 KiB193192

如何新增一个组件.mdD12-May-202418.3 KiB606442

README.md

1# JS UI Framework<a name="EN-US_TOPIC_0000001076213364"></a>
2
3
4-   [Introduction](#section15701932113019)
5-   [Directory Structure](#section1791423143211)
6-   [When to Use](#section171384529150)
7-   [Available Components](#section271831717166)
8-   [Repositories Involved](#section1447164910172)
9
10## Introduction<a name="section15701932113019"></a>
11
12The OpenHarmony JS UI framework provides basic, container, and canvas UI components and standard CSS animation capabilities. It supports the web-development-like programming paradigm.
13
14-   **Web-development-like paradigm**
15
16    The JS UI framework supports languages that are similar to those for web development, such as HTML and CSS. You can use them to describe the page layout and style, and use JavaScript \(conforming to the ECMAScript specification\) for page behavior. This paradigm allows you to avoid code for UI state switching. The view configuration information is intuitive.
17
18
19**Figure  1**  Framework architecture<a name="fig2606133765017"></a>
20![](figures/framework-architecture.png "framework-architecture")
21
22The JS UI framework consists of the application, framework, engine, and porting layers.
23
24-   **Application**
25
26    Contains apps with Feature Abilities \(FAs\) developed with the JS UI framework. The FA app in this document refers to the app with FAs developed using JavaScript.
27
28-   **Framework**
29
30    Parses UI pages and provides the Model-View-ViewModel \(MVVM\), page routing, custom components and more for front end development.
31
32-   **Engine**
33
34    Accomplishes animation parsing, Document Object Model \(DOM\) building, layout computing, rendering command building and drawing, and event management.
35
36-   **Porting Layer**
37
38    Abstracts the platform layer to provide abstract interfaces to connect to the platform. For example, event interconnection, rendering pipeline interconnection, and lifecycle interconnection.
39
40
41## Directory Structure<a name="section1791423143211"></a>
42
43The source code of the framework is stored in  **/foundation/arkui/ace\_engine**. The following shows the directory structure.
44
45```
46/foundation/arkui/ace_engine
47├── adapter                       # Platform adaptation code
48│   ├── common
49│   └── ohos
50├── frameworks                    # Framework code
51│   ├── base                      # Basic libraries
52│   ├── bridge                    # Bridging layer for frontend and backend components
53│   └── core                      # Core components
54```
55
56## When to Use<a name="section171384529150"></a>
57
58JS UI framework provides various UI components with rich functionalities and style definitions. You can use and reuse any component anywhere as needed. You can customize new components by combining existing ones to simplify development.
59
60## Available Components<a name="section271831717166"></a>
61
62**Table  1**  Components provided by the framework
63
64<a name="table2347172925617"></a>
65<table><thead align="left"><tr id="row5347429155610"><th class="cellrowborder" valign="top" width="28.64%" id="mcps1.2.3.1.1"><p id="p1347102910567"><a name="p1347102910567"></a><a name="p1347102910567"></a>Type</p>
66</th>
67<th class="cellrowborder" valign="top" width="71.36%" id="mcps1.2.3.1.2"><p id="p83475294565"><a name="p83475294565"></a><a name="p83475294565"></a>Components</p>
68</th>
69</tr>
70</thead>
71<tbody><tr id="row15347122918562"><td class="cellrowborder" valign="top" width="28.64%" headers="mcps1.2.3.1.1 "><p id="p679795614335"><a name="p679795614335"></a><a name="p679795614335"></a>Basic</p>
72</td>
73<td class="cellrowborder" valign="top" width="71.36%" headers="mcps1.2.3.1.2 "><p id="p88813982011"><a name="p88813982011"></a><a name="p88813982011"></a>button, text, input, label, image, progress, rating, span, marquee, image-animator, divider, menu, chart, option, picker, picker-view, piece, qrcode, select, slider, switch, toolbar, toolbar-item, toggle</p>
74</td>
75</tr>
76<tr id="row1973535793115"><td class="cellrowborder" valign="top" width="28.64%" headers="mcps1.2.3.1.1 "><p id="p8735195713313"><a name="p8735195713313"></a><a name="p8735195713313"></a>Container</p>
77</td>
78<td class="cellrowborder" valign="top" width="71.36%" headers="mcps1.2.3.1.2 "><p id="p1268024618208"><a name="p1268024618208"></a><a name="p1268024618208"></a>div, list, list-item, list-item-group, stack, swiper, tabs, tab-bar, tab-content, refresh, dialog, badge, panel, popup, stepper, stepper-item</p>
79</td>
80</tr>
81<tr id="row1792218915320"><td class="cellrowborder" valign="top" width="28.64%" headers="mcps1.2.3.1.1 "><p id="p692289163220"><a name="p692289163220"></a><a name="p692289163220"></a>Canvas</p>
82</td>
83<td class="cellrowborder" valign="top" width="71.36%" headers="mcps1.2.3.1.2 "><p id="p199228910327"><a name="p199228910327"></a><a name="p199228910327"></a>canvas</p>
84</td>
85</tr>
86<tr id="row837615526208"><td class="cellrowborder" valign="top" width="28.64%" headers="mcps1.2.3.1.1 "><p id="p4377752152016"><a name="p4377752152016"></a><a name="p4377752152016"></a>Grid</p>
87</td>
88<td class="cellrowborder" valign="top" width="71.36%" headers="mcps1.2.3.1.2 "><p id="p17377185222019"><a name="p17377185222019"></a><a name="p17377185222019"></a>grid-container, grid-row, grid-col</p>
89</td>
90</tr>
91</tbody>
92</table>
93
94## Repositories Involved<a name="section1447164910172"></a>
95
96JS UI framework
97
98**arkui\_ace\_engine**
99
100ace\_engine\_lite
101
102arkui\_napi
103
104

README_zh.md

1# ArkUI开发框架<a name="ZH-CN_TOPIC_0000001076213364"></a>
2
3-   [简介](#section15701932113019)
4-   [目录](#section1791423143211)
5-   [使用场景](#section171384529150)
6-   [相关仓](#section1447164910172)
7
8## 简介<a name="section15701932113019"></a>
9
10ArkUI框架是OpenHarmony UI开发框架,提供开发者进行应用UI开发时所必需的能力,包括UI组件、动画、绘制、交互事件、JS API扩展机制等。ArkUI框架提供了两种开发范式,分别是基于ArkTS的声明式开发范式(简称“声明式开发范式”)和兼容JS的类Web开发范式(简称“类Web开发范式”)。
11
12**图 1**  ArkUI框架结构<a name="fig2606133765017"></a>
13![](figures/ArkUI框架结构.png "ArkUI框架结构")
14
15从上图可以看出,类Web开发范式与声明式开发范式的UI后端引擎和语言运行时是共用的,其中,UI后端引擎实现了ArkUI框架的六种基本能力。声明式开发范式无需JS Framework进行页面DOM管理,渲染更新链路更为精简,占用内存更少,因此更推荐开发者选用声明式开发范式来搭建应用UI界面。
16
17
18## 目录<a name="section1791423143211"></a>
19
20ArkUI开发框架源代码在/foundation/arkui/ace\_engine下,目录结构如下图所示:
21
22```
23/foundation/arkui/ace_engine
24├── adapter                       # 平台适配目录
25│   ├── common
26│   └── ohos
27├── frameworks                    # 框架代码
28│   ├── base                      # 基础库
29│   ├── bridge                    # 前后端组件对接层
30│   └── core                      # 核心组件目录
31```
32
33## 使用场景<a name="section171384529150"></a>
34
35ArkUI框架提供了丰富的、功能强大的UI组件、样式定义,组件之间相互独立,随取随用,也可以在需求相同的地方重复使用。开发者还可以通过组件间合理的搭配定义满足业务需求的新组件,减少开发量。
36
37## 相关仓<a name="section1447164910172"></a>
38
39[ArkUI框架子系统](https://gitee.com/openharmony/docs/blob/master/zh-cn/readme/ArkUI%E6%A1%86%E6%9E%B6%E5%AD%90%E7%B3%BB%E7%BB%9F.md)
40
41**arkui\_ace\_engine**
42
43[arkui\_ace\_engine\_lite](https://gitee.com/openharmony/arkui_ace_engine_lite)
44
45[arkui\_napi](https://gitee.com/openharmony/arkui_napi)
46
47