Files
Starlight_Lancher/.agents/skills/lark-im/references/card/components/column_set.md

2.5 KiB
Raw Blame History

分栏 column_set + column

横向多列布局容器。column_set 装若干 column,每个 column 内再放组件。Card 2.0

最小示例

{
  "tag": "column_set",
  "flex_mode": "none",
  "columns": [
    { "tag": "column", "width": "weighted", "weight": 1,
      "elements": [{ "tag": "markdown", "content": "左列" }] },
    { "tag": "column", "width": "weighted", "weight": 1,
      "elements": [{ "tag": "markdown", "content": "右列" }] }
  ]
}

column_set 字段

字段 必填 类型 默认 说明
tag String / 固定 column_set
columns column[] / 列数组,子节点只能是 column
flex_mode String none 窄屏自适应:none(按比例压缩) / stretch(变上下堆叠) / flow(自动换行) / bisect(两等分) / trisect(三等分)
horizontal_spacing String 8px small(4)/medium(8)/large(12)/extra_large(16) 或 [0,99]px
horizontal_align String left left / center / right
background_style String default default 或颜色枚举/RGBA../resource/colors.md);嵌套时上层覆盖下层
action Object / 整块点击跳转 { multi_url:{url,pc_url,ios_url,android_url} }
margin String 0 外边距 [-99,99]px

column 字段

字段 必填 类型 默认 说明
tag String / 固定 column
elements Element[] / 列内组件;不能放 formtable,可放 column_set
width String auto flex_mode:none 生效:auto / weighted(配 weight) / [16,600]px
weight Number 1 width:weighted 时的宽度占比1~5 整数
vertical_align String top top / center / bottom
direction String vertical vertical / horizontal
horizontal_spacing/vertical_spacing String 8px 同上间距枚举或 [0,99]px
padding String 0 内边距 [0,99]px
margin String 0 外边距 [-99,99]px
background_style String default 同上
action Object / 点击列跳转,同 column_set.action

嵌套 / 易错点

  • column_set 的直接子节点只能是 column;不能 column_set → column_set。二级分栏要走 column_set → column → column_set
  • column 内可放除 form / table 外的所有组件。
  • 最多嵌套 5 层,过深会压缩展示空间。