Files

1.8 KiB
Raw Permalink Blame History

下拉单选 select_static

下拉菜单单选。Card 2.0

最小示例

{
  "tag": "select_static",
  "placeholder": { "tag": "plain_text", "content": "请选择" },
  "options": [
    { "text": { "tag": "plain_text", "content": "选项1" }, "value": "1" },
    { "text": { "tag": "plain_text", "content": "选项2" }, "value": "2" }
  ]
}

字段

字段 必填 类型 默认 说明
tag String / 固定 select_static
options Array / 选项,见下
options[].text Object / 选项名plain_text
options[].value String / 选项回调值,同组件内不可重复
options[].icon Object / 选项前缀图标(同 div.icon
name 否* String / 唯一标识;form 内必填且全局唯一
required Boolean false 是否必选form 内生效)
type String default default(带框) / text(纯文本)
placeholder Object / 占位文本plain_text
initial_option String / 初始选中内容(覆盖 placeholder 和 initial_index
initial_index Int / 初始选中序号0=不选1=第一个
width String default default / fill / [100,∞)px
disabled Boolean false 是否禁用
behaviors Array / [{type:"callback", value:{...}}]
confirm Object / 二次确认弹窗 {title, text}
margin String 0 外边距 [-99,99]px

嵌套 / 易错点

  • 可嵌套在 column_set / form / collapsible_panel / 循环容器 / interactive_container 内。
  • 选项 value 必须唯一,否则交互异常、服务端无法区分选了哪个。
  • 回调 action.tag="select_static" + action.option(选中项的 value