iter(g91): 表单字段补辅助说明 hint

This commit is contained in:
HIsheR
2026-10-26 13:10:40 +08:00
parent 46a90daf32
commit 47756c899a
8 changed files with 39 additions and 6 deletions
+8
View File
@@ -1084,6 +1084,14 @@
"acceptance": "npm run changelog 重新生成(253 提交),changelog:check 不再报漂移(提交本条后按既有约定会再差一条,属正常);npm run check 全绿",
"notes": "自补:发版前刷新步骤,按 g64/g77 的既定方式执行",
"status": "done"
},
{
"id": "g91",
"title": "表单字段补辅助说明 hint",
"motivation": "formItem 只有 label 与错误位,没有「格式提示」的位置:调用方只能把说明塞进 placeholder 或标签里,一报错提示就被替换得无处可看,用户不知道正确格式是什么",
"acceptance": "FormItemProps 新增可选 hint,渲染在控件下方;校验失败时 hint 让位(hidden)只留错误文案,校验通过自动恢复;样式走令牌;文档参数表(formItem 前缀)与演示同步;npm run check 全绿",
"notes": "自补:表单可用性;不改 formItem 返回句柄与 form 聚合逻辑",
"status": "open"
}
]
}
+8 -2
View File
@@ -1,6 +1,6 @@
{
"$schema": "ui-arch-registry-index/0.1",
"generatedAt": "2026-10-26T05:08:07.129Z",
"generatedAt": "2026-10-26T05:10:23.912Z",
"repoRoot": ".",
"packages": [
{
@@ -1697,6 +1697,11 @@
"d": "校验时机;缺省 blur(输入时自动清已报错误)",
"df": "blur"
},
{
"n": "(formItem)hint",
"t": "string",
"d": "控件下方辅助说明(格式提示等);报错时让位给错误文案"
},
{
"n": "onReset",
"t": "() => void",
@@ -1715,7 +1720,8 @@
"触发时机用 input / change / focusout(均会冒泡),因此 checkbox / select / 单选组这类包裹式控件同样能失焦校验",
"单行输入框内按 Enter 等同点击提交(textarea 内仍是换行);提交按钮为 type=\"submit\",不会与点击回调重复触发",
"rules.validator 返回 Promise 即为异步规则(如「邀请码是否已被使用」远程校验):提交时逐项 await,校验期间提交按钮禁用,结论按轮次取舍避免乱序覆盖",
"formItem 返回 { el, validate, validateAsync } 句柄:validate 只跑同步规则(供 blur/input 即时反馈),validateAsync 逐条 await 供 form 聚合提交"
"formItem 返回 { el, validate, validateAsync } 句柄:validate 只跑同步规则(供 blur/input 即时反馈),validateAsync 逐条 await 供 form 聚合提交",
"需要给字段加格式说明就传 hint:平时显示在控件下方,校验失败时自动让位给错误文案,同一位置不堆两行"
]
},
{