Files
marqdo/examples/browser-app/components/controls.mq.md
T
cflmy 9331af78e2 release(2.8.0): 合入 CHANGELOG/README/发版说明/skills prove 任务;CI 链接指向 doc/releases
- CHANGELOG.md:v2.8.0 条目(中英双语);
- README.md:版本行 2.7.1→2.8.0 + 愿景第 6 条(知识可证明);
- doc/releases/v2.8.0.md:双语发版说明(亮点/用法/已知限制);
- skills/marqdo-dev/index.mq.md:新增 prove 任务(路径/目录模式/
  require_lean/json;参数用 + 行声明升参,check 与 narrative-ratio 通过);
- 设计文档 §12.5 标记已合入;发版链接统一指向 doc/releases/v2.8.0.md。
2026-11-18 10:29:26 +08:00

2.7 KiB
Executable File

markup, title, import
markup title import
occlusion Native browser control leaves
component table
ext/web/component/index.mq.md lib/table.mq.md

button

参数 类型 默认 说明
id text required Event target shared with the client wire table
label text required Literal visible action
secondary bool False Use the retained secondary palette
返回 类型 说明
result list One disabled native button awaiting successful runtime boot

Use id, label and secondary=False for one leaf. The button starts disabled, carries type button and is enabled only after the official runtime boots successfully. Its label remains plain text. The caller chooses placement; this helper neither binds a click handler nor hides a sibling layout. Keep its id aligned with static/app.mq.md.

attrs =

id type disabled
id button True

We style = "".

  1. secondary We style = "secondary". Return [Describe one literal native action](component.element(kind="button", value=label, attrs=attrs, style=style, slot=id)).

input

参数 类型 默认 说明
id text required Client value target
hint text required Plain placeholder text
返回 类型 说明
result list One disabled text input

Use id and hint for the draft or socket message. A native text input preserves its ordinary editing semantics and starts disabled until WASM is ready. The hint is placeholder text rather than a markup template. The component owns one control; the client selects its value through the wire table when the adjacent action is clicked.

attrs =

id type placeholder disabled
id text hint True

Return [Describe this native value input](component.element(kind="input", attrs=attrs, slot=id)).

text

参数 类型 默认 说明
id text required Stable output target
value text required Literal initial text
kind text "text" Native text or pre output
返回 类型 说明
result list One escaped text leaf

Use id, value and kind="text" for an output target. Select pre for the runtime log and ordinary text for the path, tick count or network outcome. Initial and later content stays literal: the renderer escapes this value and callbacks use set_text. This leaf declares no timer or network operation; those belong to the browser program.

We attrs = [Retain the exact output target](table.put(in=None, at="id", value=id)). Return [Describe the literal output leaf](component.element(kind=kind, value=value, attrs=attrs, slot=id)).