目录

Basic Syntax Overview

With a basic understanding of the ArkTS language, let's examine its structural composition through a practical example.

The following demonstration shows a text element that changes from Hello World to Hello ArkUI when a button is clicked.

Figure 1 Example

In this example, the basic composition of ArkTS is as follows.

Figure 2 Basic composition of ArkTS

Custom variables must not share names with universal attributes or events.

ArkTS introduces several advanced syntax features designed to improve developer productivity and code maintainability.