QORMQORM v0.8.4 api 开始使用 EN

节点与组件属性

由源码自动生成(TestAPIRef),请勿手工编辑。下方的属性表从代码抽取,不会与实现漂移。

每个 QORM 应用据以编写的声明式契约。界面是一棵节点树,每个节点是一个 JSON 对象。

节点结构

每个节点对象可携带这些顶层键:

类型含义
typestring组件名——见组件目录;可为 {{ 绑定 }}(如 {{ item.kind }}),渲染期按当前作用域求值决定节点类型,因此一个模板可按数据渲染成不同组件
idstring稳定的节点 id(用于状态绑定、补丁、data-state)
textstring文本内容(text/heading/paragraph 节点)
labelstring按钮 / 控件标签
placeholderstring输入框占位符
valuestring输入值或绑定值;可含 {{ binding }}
styleobject视觉样式——见通用样式属性
layoutobject布局提示:width height align justify
onPressaction / string按下处理器——动作 id 或内联 steps
onChangeaction / string变化处理器(输入、开关、滑块、下拉)
onKeyDownaction / string按键按下处理器——先发给焦点节点,未处理再冒泡到场景根;按键名作为 key 参数注入,以 {{ key }} 读取(原生 canvas 后端)
onKeyUpaction / string按键抬起处理器(分发同 onKeyDown)
renderItemnode绑定 list 的条目模板
datastring列表数据绑定表达式(如 state.todos)
childrennode[]子节点
conditionstringwhen 节点:基于 viewport.width / viewport.height / viewport.orientation{{ … }} 表达式,真值渲染 then,否则渲染 else;视口未知(服务端首帧)按假值处理
thennodewhen 节点:condition 为真时渲染的子树
elsenodewhen 节点:否则渲染的子树(与隐藏单个节点的 if 属性不同,when 在两棵备选子树间切换)
any其余任何键都是组件专有属性(见下表)

通用样式属性

由共享渲染器读取,任何绘制盒子的节点都可用:

各组件专有属性

在上述通用样式属性之外,每个渲染器额外读取的专有键。由 internal/rendernode() 分发自动抽取—— 表示该组件只接受通用属性。

组件属性
accordionactive · single · title
actionsheetdismissable · open · title
activityindicatorsize
alerttitle · variant
alertdialogdismissable · message · open · title
animatedcontainercurve · duration
animatedopacityduration · opacity
appbarbackground · leading
aspectratioratio
autocompletedebounce · options
avatarinitials · name · size · src
backbutton
badgecolor · showZero · smallSize
barometerlabel
batterylabel
biometriclabel
bluetoothlabel
board
bottomappbar
bottomnavitems
breadcrumbitems · separator
brightness
buttonnovalidate · submit · submitOnEnter · variant
calendarlabel
cameralabel
carouselautoplay · indicators
chartchartType · color · data
checkboxchecked · debounce
chipavatar · selected · showCheck
circularprogresscolor · size · stroke · value
clipboardlabel
closebutton
compasslabel
contactslabel
contextmenuitems · menuStyle
datatableas · column · columns · data · detail · maxHeight · minWidth · rowKey · scrollX · selectable · selected · sortData · sortDir · sortField · stickyHeader · stickyTop
datepickermaxYear · minYear
descriptionsitems
deviceinfolabel
dismissibleicon · onDismissed
dividerorientation
dockbadge
draggabledata
dragtargetonDrop
draweropen · side
dropdownbuttonhint · options
emptyicon · title
expansiontileinitiallyExpanded · leading
fabextended
fielderror · help · label · required
filepickerlabel
formnovalidate
gesturedetectoronDoubleTap · onLongPress
gridviewas · crossAxisCount · minItemWidth · page · pageSize · spacing
hapticslabel
iconglyph · icon · size
ignorepointer
imagealt · fallback · fit · lazy · placeholder · src
indexedstackindex
inputautocomplete · autofocus · debounce · inputMode · inputType · maxLength · pattern · readonly · required · requiredMessage
insetslabel
keepawakelabel
largetitlebackground · collapsible · subtitle
limitedboxmaxHeight · maxWidth
linkhref
listas · groupBy · itemHeight · onRefresh · onReorder · overscan · page · pageSize · reorderable · sectionHeader · separator · sticky · stickyTop · virtualize
listsectionfooter · header
listtilechevron · leading · subtitle · trailing
locationlabel
loginitem
materialstepperactive · steps
menuitems
modaldismissable · open · title
monthviewevents · heading · max · min · month · onMonthChange · selected · showAdjacent · today · weekStart · weekdays
navigationdraweritems
navigationrailitems
networklabel
nfclabel
notify
offstageoffstage
openurllabel
orientationlabel
pageview
paginationpage · total
pedometerlabel
photopickerlabel
pickeroptions
progresscolor
proximitylabel
qrscanlabel
radiodebounce · options
rangesliderdebounce · high · low · max · min · step
ratingmax · size · value
recorderlabel
refreshindicatoronRefresh
richtextspans
scaffold
screenrecordlabel
screens
screenshotlabel
searchbardebounce · hint · items · onSelect
securestoragelabel
segmenteddebounce · multiple · options
selectdebounce · options
selectabletext
sensorslabel
sharelabel
sheetbackdrop · dismissable · handle · initialSnap · onClose · onSnap · open · snapPoints · title
skeleton
sliderdebounce · max · min · step
slotname · slot
snackbaraction · open
spacer
spinnercolor · size
statdelta · deltaType · label · value
stepsactive · steps
storagelabel
sttlabel
swipeactionsactions
switchlisttilesubtitle · value
systemmodeslabel
tableas · column · columns · data · detail · maxHeight · minWidth · scrollX · sortData · sortDir · sortField · stickyHeader · stickyTop
tabsactive · indicator · indicatorColor · lazy · scrollable · swipe · tabs
tag
text
textareaautocomplete · autofocus · debounce · inputMode · maxLength · pattern · readonly · required · requiredMessage · rows
textformfieldautocomplete · autofocus · debounce · error · helper · inputMode · inputType · label · maxLength · pattern · prefix · readonly · required · requiredMessage · suffix
timelineitems
timepickerminuteStep
timer
tooltipfocusable · maxWidth · placement · position · tooltip
torchlabel
transformrotate · scale · scaleX · scaleY · skew · translateX · translateY
treecollapsed · data
ttslabel
verticaldividerorientation
vibratelabel
videosrc
videocapturelabel
volume
webviewhtml · src · url
when
wifilabel
wraprunSpacing · spacing