iter(e04): 新增 empty 空状态组件
This commit is contained in:
+26
-2
@@ -1,6 +1,6 @@
|
||||
# @ui-arch 组件库 Agent 文档(无图形版)
|
||||
|
||||
> 自动生成于 2026-10-23T10:03:21.198Z,数据源:各包 ua.manifest.json,勿手改。人类版文档站:apps/docs/index.html。
|
||||
> 自动生成于 2026-10-23T10:11:22.346Z,数据源:各包 ua.manifest.json,勿手改。人类版文档站:apps/docs/index.html。
|
||||
> 组件 = 普通函数,传 props 返回 DOM;状态用 signal 双向绑定:读 signal() 写 signal(v)。
|
||||
|
||||
## 快速上手
|
||||
@@ -674,6 +674,28 @@ const score = signal(0); rate({ value: score, max: 5, onChange: (v) => console.l
|
||||
|
||||
现场演示:apps/docs/demo.html#sec-rate
|
||||
|
||||
### empty — 空状态 Empty
|
||||
|
||||
参数:
|
||||
|
||||
- title:string —— 主标题;缺省不渲染
|
||||
- description:string —— 补充说明;缺省不渲染
|
||||
- action:unknown —— 操作区内容(常见为按钮);缺省不渲染
|
||||
|
||||
示例:
|
||||
|
||||
```
|
||||
empty({ title: '暂无数据', description: '调整筛选条件后再试', action: button({ label: '重置筛选', variant: 'ghost' }) })
|
||||
```
|
||||
|
||||
手把手:
|
||||
|
||||
1. 在列表 / 表格 / 筛选结果为空时渲染 empty 占位
|
||||
2. title 一句话说明状态,description 补充原因或建议
|
||||
3. action 传入 DOM(如 ghost 按钮)引导用户下一步操作
|
||||
|
||||
现场演示:apps/docs/demo.html#sec-empty
|
||||
|
||||
### pagination — 分页器 Pagination
|
||||
|
||||
参数:
|
||||
@@ -851,6 +873,7 @@ API 速览:
|
||||
- tabs(props):标签页,active 信号双向绑定,滑动指示条 + 方向键环形导航,支持禁用页签
|
||||
- stepper(props):步骤条,done/current/upcoming 三态,active 信号双向绑定,clickable 时已完成步骤可回跳
|
||||
- rate(props):评分星标,value 信号双向绑定,hover 预览移出还原,键盘方向键调节,max 可配
|
||||
- empty(props):空状态占位,title/description 可选,action 放操作区
|
||||
- modal(props, ...children):弹窗,open 信号驱动显隐,Esc / 遮罩 / × 关闭,size 三档宽度,footer 提供底部操作区
|
||||
- drawer(props, ...children):抽屉,open 信号驱动侧滑面板,placement 左右可配、width 可调、footer 操作区,遮罩 / × / Esc 关闭
|
||||
- form(props, items):表单容器,布局 + 聚合校验,全部通过才触发 onSubmit
|
||||
@@ -953,12 +976,13 @@ API 速览:
|
||||
- ua docs:生成人类文档站 apps/docs/index.html + demo.html 与 Agent 全量文档 llms-full.txt
|
||||
- ua style:注释规范门禁(导出必须 /*** ***/、接口字段行尾注释、行注释中文),违规退出码 1
|
||||
- ua verify:清单一致性门禁(id 唯一 / exports 对应 / props 必带 n t d / steps≥3 / demo 锚点存在)
|
||||
- ua commit-lint <文件|message>:提交信息门禁(type 枚举 / scope 规则 / subject 中文祈使 ≤50 字符),规范见 COMMITTING.md,违规退出码 1
|
||||
- ua mcp:零依赖 stdio MCP server,暴露 list_components / get_component / search_components
|
||||
|
||||
一行用法:
|
||||
|
||||
```
|
||||
node packages/tools/cli/bin/ua.js <index|list|info <name>|docs|style|verify|mcp>;仓库内等价于 npm run index / docs / style / verify
|
||||
node packages/tools/cli/bin/ua.js <index|list|info <name>|docs|style|verify|commit-lint|mcp>;仓库内等价于 npm run index / docs / style / verify
|
||||
```
|
||||
|
||||
约定:
|
||||
|
||||
Reference in New Issue
Block a user