iter: b05 文档站 props 表补齐默认值列(df 字段),manifest 驱动链路核查闭环

This commit is contained in:
HIsheR
2026-10-23 16:03:47 +08:00
parent 8c9a63b5d2
commit 83bc1e241c
6 changed files with 88 additions and 55 deletions
+32 -16
View File
@@ -92,7 +92,8 @@
{
"n": "variant",
"t": "'primary' | 'ghost' | 'danger'",
"d": "视觉强度;缺省 primary"
"d": "视觉强度;缺省 primary",
"df": "primary"
},
{
"n": "onClick",
@@ -150,7 +151,8 @@
{
"n": "rows",
"t": "number",
"d": "初始行数;缺省 3"
"d": "初始行数;缺省 3",
"df": "3"
},
{
"n": "placeholder",
@@ -332,7 +334,8 @@
{
"n": "variant",
"t": "'default' | 'success' | 'warning' | 'danger'",
"d": "语义色;缺省 default"
"d": "语义色;缺省 default",
"df": "default"
}
],
"example": "badge({ label: '成功', variant: 'success' })",
@@ -355,7 +358,8 @@
{
"n": "variant",
"t": "'info' | 'success' | 'warning' | 'danger'",
"d": "语义色;缺省 info"
"d": "语义色;缺省 info",
"df": "info"
}
],
"example": "alert({ message: '操作可能存在风险', variant: 'warning' })",
@@ -372,12 +376,14 @@
{
"n": "variant",
"t": "'text' | 'rect' | 'circle'",
"d": "占位形状;缺省 rect(整块矩形)"
"d": "占位形状;缺省 rect(整块矩形)",
"df": "rect"
},
{
"n": "rows",
"t": "number",
"d": "text 形状的行数;缺省 3,末行自动缩短模拟段落"
"d": "text 形状的行数;缺省 3,末行自动缩短模拟段落",
"df": "3"
}
],
"example": "skeleton({ variant: 'text', rows: 3 }); skeleton({ variant: 'circle' }); skeleton({ variant: 'rect' })",
@@ -402,12 +408,14 @@
{
"n": "duration",
"t": "number",
"d": "自动消失毫秒;缺省 3000"
"d": "自动消失毫秒;缺省 3000",
"df": "3000"
},
{
"n": "variant",
"t": "'info' | 'success' | 'warning' | 'danger'",
"d": "语义色;缺省 info(toast.error 对应 danger)"
"d": "语义色;缺省 info(toast.error 对应 danger)",
"df": "info"
}
],
"example": "toast.success('保存成功'); toast.error('网络请求失败', 5000)",
@@ -432,12 +440,14 @@
{
"n": "placement",
"t": "'top' | 'bottom'",
"d": "气泡方位;缺省 top(触发器上方)"
"d": "气泡方位;缺省 top(触发器上方)",
"df": "top"
},
{
"n": "delay",
"t": "number",
"d": "出场延迟毫秒;缺省 150,传 0 立即显示"
"d": "出场延迟毫秒;缺省 150,传 0 立即显示",
"df": "150"
},
{
"n": "trigger",
@@ -464,7 +474,8 @@
{
"n": "size",
"t": "number",
"d": "直径像素;缺省 18"
"d": "直径像素;缺省 18",
"df": "18"
}
],
"example": "spinner(); spinner({ size: 26 })",
@@ -487,7 +498,8 @@
{
"n": "showText",
"t": "boolean",
"d": "是否显示百分比文字;缺省 true"
"d": "是否显示百分比文字;缺省 true",
"df": "true"
}
],
"example": "const pct = signal(0); progress({ value: pct }); setInterval(() => pct((pct() + 5) % 105), 400)",
@@ -613,7 +625,8 @@
{
"n": "layout",
"t": "'vertical' | 'horizontal'",
"d": "布局方向;缺省 vertical(horizontal 为标签左置)"
"d": "布局方向;缺省 vertical(horizontal 为标签左置)",
"df": "vertical"
},
{
"n": "submitText",
@@ -656,7 +669,8 @@
{
"n": "(formItem)validateOn",
"t": "'input' | 'blur' | 'submit'",
"d": "校验时机;缺省 blur(输入时自动清已报错误)"
"d": "校验时机;缺省 blur(输入时自动清已报错误)",
"df": "blur"
}
],
"example": "const name = signal(''); const f = form({ onSubmit: submit }, [formItem({ label: '用户名', required: true, value: name, rules: [{ min: 2, max: 12 }] }, textField({ value: name }))])",
@@ -694,12 +708,14 @@
{
"n": "pageSize",
"t": "number",
"d": "每页行数;缺省 5"
"d": "每页行数;缺省 5",
"df": "5"
},
{
"n": "selectable",
"t": "boolean",
"d": "启用行选择列:全选三态(含半选)、行 checkbox、已选计数;缺省 false"
"d": "启用行选择列:全选三态(含半选)、行 checkbox、已选计数;缺省 false",
"df": "false"
},
{
"n": "page",
+3 -3
View File
@@ -191,9 +191,9 @@ var ORDER={skin-dom:0,'headless-core':1,'design-tokens':2};
function esc(s){return String(s).replace(/&/g,'&amp;').replace(/</g,'&lt;').replace(/>/g,'&gt;')}
function propsTable(c){
var rows=(c.props||[]).map(function(p){
return '<tr><td><code>'+esc(p.n)+'</code></td><td><code>'+esc(p.t)+'</code></td><td>'+(p.r?'必填':'否')+'</td><td>'+esc(p.d||'')+(p.k?'(回调)':'')+'</td></tr>';
return '<tr><td><code>'+esc(p.n)+'</code></td><td><code>'+esc(p.t)+'</code></td><td>'+(p.r?'必填':'否')+'</td><td>'+(p.df?'<code>'+esc(p.df)+'</code>':'—')+'</td><td>'+esc(p.d||'')+(p.k?'(回调)':'')+'</td></tr>';
}).join('');
return '<table class="props"><tr><th>参数</th><th>类型</th><th>必填</th><th>说明</th></tr>'+rows+'</table>';
return '<table class="props"><tr><th>参数</th><th>类型</th><th>必填</th><th>默认值</th><th>说明</th></tr>'+rows+'</table>';
}
function compBlock(c){
var steps=(c.steps||[]).map(function(s){return '<li>'+esc(s)+'</li>'}).join('');
@@ -289,7 +289,7 @@ function renderAgentDocs(index, tokens) {
if (c.props?.length) {
lines.push('参数:', '');
for (const prop of c.props) {
const marks = [prop.r ? '必填' : '', prop.k ? '回调' : ''].filter(Boolean).join(',');
const marks = [prop.r ? '必填' : '', prop.k ? '回调' : '', prop.df ? `默认 ${prop.df}` : ''].filter(Boolean).join(',');
lines.push(`- ${prop.n}${marks ? `(${marks})` : ''}:${prop.t}${prop.d ? ` —— ${prop.d}` : ''}`);
}
lines.push('');