1 Star 0 Fork 5.1K

youguilin / docs

forked from OpenHarmony / docs 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
universal-attributes.md 20.92 KB
一键复制 编辑 原始数据 按行查看 历史
mamingshuai 提交于 2021-06-02 01:00 . update OpenHarmony 2.0 Canary

Universal Attributes

Common Attributes

Common attributes are used to set component identities and appearance.

Name

Type

Default Value

Mandatory

Description

id

string

-

No

Unique ID of a component.

style

string

-

No

Style declaration of a component.

class

string

-

No

Style class of a component, which is used to refer to a style table.

ref

string

-

No

Used to register reference information of child elements or child components. The reference information is registered with the parent component on $refs.

disabled

boolean

false

No

Whether a component is disabled. If it is disabled, it cannot respond to user interaction.

data

string

-

No

Attribute set for a component to facilitate data storage and reading.

click-effect5+

string

-

No

Click effect complying with spring physics. Available values are as follows:

  • spring-small: The button icon scales down to 90% of its size when it is selected. This is appropriate for small icons.
  • spring-medium: The component scales down to 95% of its size when it is selected. This is appropriate for medium-sized components.
  • spring-large: The button icon scales down and up by 95% of its size, which is appropriate to large icons.

Rendering Attributes

Rendering attributes are used to set whether a component is rendered.

Name

Type

Default Value

Description

for

Array

-

Expands the current element based on the configured data list.

if

boolean

-

Whether the element is added or removed.

show

boolean

-

Whether the element is displayed or hidden.

NOTE: Do not set styles in attribute fields.

1
https://gitee.com/yougl/docs.git
git@gitee.com:yougl/docs.git
yougl
docs
docs
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891