Appearance
模板能力矩阵
数据由
js/qtx-compiler/qtx-tpl-loader.js的常量提取,不是手抄的手册。编译器改了白名单,重跑npm run docs:gen即同步 —— 这是 S-015/S-016「手册与编译器措辞漂移」的根治方式。
嵌套子列表支持的配置属性(NESTED_PROPS)
columnsdirectiongutteritemHeightitemsclipChildrenclipPadding
其中 clipChildren / clipPadding 为布尔语义属性,编译产物保留原生布尔值;其余按字符串下发。未在此白名单内的属性会导致整段模板回落运行时捕获,构建期打印 [QTX-T-EXPR] 并指出属性所在行与实例序号。
跳过(不视为超纲)的属性(NESTED_SKIP_ATTRS)
keyreftpl-keyclassstyleid
class 声明可映射到布局的键(LAYOUT_KEYS)
widthheightmargin-topmargin-bottommargin-leftmargin-rightpadding-toppadding-bottompadding-leftpadding-rightfont-sizeborder-radiusbackground-colorcolortext-colorborder-widthborder-colorborder-top-left-radiusborder-top-right-radiusborder-bottom-left-radiusborder-bottom-right-radiusflex-directionalign-itemsjustify-contenttext-alignfont-weightresize-modenumber-of-linesellipsize-modeposition-typelefttoprightbottomfocus-background-colorfocus-color
动态 :class 字面量三元会编译为 binds.class + styleMap;布局类键转成 binds.<key> 的 cond 描述符。非字面量 :class 仍回落。
表达式描述符类型(parseExprV2 产出的 k)
concatcondfmtlitoppath
诊断标签怎么读
| 标签 | 含义 | 处理 |
|---|---|---|
[QTX-T-EXPR] | 编译期发现超纲写法,已回落运行时捕获(功能通常不损,但不在 v2 路径) | 按警告点名的属性所在行改写;全仓应为 0 |
[QTX-T-EXPECTED] | 仓库里故意保留的负面测试用例,显式门禁标记 | 只允许声明清单内的文件产生,不升 strict 错误 |