Skip to content

模板能力矩阵 ​

数据由 js/qtx-compiler/qtx-tpl-loader.js 的常量提取,不是手抄的手册。编译器改了白名单,重跑 npm run docs:gen 即同步 —— 这是 S-015/S-016「手册与编译器措辞漂移」的根治方式。

嵌套子列表支持的配置属性(NESTED_PROPS) ​

  • columns
  • direction
  • gutter
  • itemHeight
  • items
  • clipChildren
  • clipPadding

其中 clipChildren / clipPadding 为布尔语义属性,编译产物保留原生布尔值;其余按字符串下发。未在此白名单内的属性会导致整段模板回落运行时捕获,构建期打印 [QTX-T-EXPR] 并指出属性所在行与实例序号。

跳过(不视为超纲)的属性(NESTED_SKIP_ATTRS) ​

  • key
  • ref
  • tpl-key
  • class
  • style
  • id

class 声明可映射到布局的键(LAYOUT_KEYS) ​

  • width
  • height
  • margin-top
  • margin-bottom
  • margin-left
  • margin-right
  • padding-top
  • padding-bottom
  • padding-left
  • padding-right
  • font-size
  • border-radius
  • background-color
  • color
  • text-color
  • border-width
  • border-color
  • border-top-left-radius
  • border-top-right-radius
  • border-bottom-left-radius
  • border-bottom-right-radius
  • flex-direction
  • align-items
  • justify-content
  • text-align
  • font-weight
  • resize-mode
  • number-of-lines
  • ellipsize-mode
  • position-type
  • left
  • top
  • right
  • bottom
  • focus-background-color
  • focus-color

动态 :class 字面量三元会编译为 binds.class + styleMap;布局类键转成 binds.<key> 的 cond 描述符。非字面量 :class 仍回落。

表达式描述符类型(parseExprV2 产出的 k) ​

  • concat
  • cond
  • fmt
  • lit
  • op
  • path

诊断标签怎么读 ​

标签含义处理
[QTX-T-EXPR]编译期发现超纲写法,已回落运行时捕获(功能通常不损,但不在 v2 路径)按警告点名的属性所在行改写;全仓应为 0
[QTX-T-EXPECTED]仓库里故意保留的负面测试用例,显式门禁标记只允许声明清单内的文件产生,不升 strict 错误

API 事实由源码自动生成 · 请勿手工编辑