目录

General Attributes

Common Attributes

Attribute

Type

Default Value

Description

id

string

-

Unique ID.

style

string

-

Style.

class

string

-

Reference style.

disabled

boolean

false

Indicates whether the current element is available.

focusable

boolean

false

Indicates whether the focus can be obtained.

If Vision products need to respond to remote control events, focusable must be set to true.

data

string

-

The data attribute can be set for elements to facilitate data storage and reading.

dir (1070+)

string

-

Script writing direction of an element.

  • ltr: from left to right
  • rtl: from right to left
  • auto: automatically set by the system

If this parameter is not set, the value of dir of the parent element is inherited. If the element is at the top level, the system settings are used.

CAUTION:
  • The value ltr of the dir attribute does not take effect for the marquee element when the script writing direction is right-to-left, for example, Arabic.
  • For a version earlier than EMUI 9.1, the value ltr of the dir attribute does not take effect for the select, input, and switch elements when the script writing direction is right-to-left, for example, Arabic.

Rendering Attributes

Attribute

Type

Default Value

Description

for

array

-

Loop that consists of an array.

if

boolean

-

Indicates whether to add or remove the current tag.

show

boolean

-

Indicates whether to show the current element, which is equivalent to { display: flex | none }.

For details about how to use rendering attributes, please refer to Template.

Do not mix up attributes and styles or set styles in attributes.