SQL 结果表
SqlResultTable后台工具SQL 结果表按单元格类型优雅渲染布尔徽章、等宽数字、文本与 NULL 值,支持点击任意行展开跨列完整详情;可切换预设查询观察不同数据结构。
SELECT id, title, slug, published, views, deleted_at FROM posts ORDER BY id DESC LIMIT 4;4 行 · 12ms| 展开 | id | title | slug | published | views | deleted_at |
|---|---|---|---|---|---|---|
| 108 | 让想法生根 | roots-of-thought | true | 1280 | NULL | |
id108 title让想法生根 slugroots-of-thought publishedtrue views1280 deleted_atNULL | ||||||
| 107 | 在时间的缝隙里种下文字 | writing-in-time | true | 856 | NULL | |
| 106 | 未命名草稿:微风与山岗 | draft-whispering-wind | false | 42 | NULL | |
| 105 | 已归档随笔:初春记事 | archived-early-notes | false | 310 | 2026-09-01 14:20 | |
本地演示,内容不会保存
属性
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
result | SqlResult | 由调用方提供 | 后端返回的结果集(列名与每格的 JSON 值)。 |
initial_expanded | MaybeProp<usize> | None | 初始展开的行索引;缺省全部收起。 |
用法
src/components/sql_result_table.rsview! {
<SqlResultTable result=sql_result/>
}