属性

[English]

概览

本文档负责各控件类型 / 语义分组的 props 域,以及 bindings 可指向的 props 叶子字段。公开 JSON 使用 camelCasebindings key 也使用公开 camelCase 点路径。

本文档不负责 layout / placement / style / events / animations。这些内容请查看对应文档。

相关文档

总体规则

公开 JSON 使用显式的 props 域:

Props 域

适用控件类型

子文档

commonProps

全部控件类型

commonProps

labelProps

label / checkbox

labelProps

imageProps

image

imageProps

textInputProps

textInput

textInputProps

rangeProps

slider / progressBar / arc

rangeProps

toggleProps

switch / checkbox

toggleProps

dropdownProps

dropdown

dropdownProps

tableProps

table

tableProps

lineProps

line

lineProps

keyboardProps

keyboard

keyboardProps

canvasProps

canvas

canvasProps

frameViewProps

frameView

frameViewProps

子文档

Binding 路径

bindings 若要绑定 props,必须使用公开 camelCase 点路径,例如:

"bindings": {
    "labelProps.text": "status",
    "textInputProps.placeholder": "placeholder",
    "rangeProps.value": "value"
}

每个子文档的字段表会列出当前字段是否支持 binding。

不使用专属 props 的控件类型

以下控件类型当前没有专属 props 域,通常只使用 commonProps 和其他模块字段:

  • screen

  • container

  • button

  • spinner

其中:

  • button 若需要文案,继续推荐显式添加子 label

  • spinner 暂无专属 JSON props