Skip to content

Commit

Permalink
chore(form): 添加注释
Browse files Browse the repository at this point in the history
  • Loading branch information
xiamiao committed Jul 24, 2024
1 parent 9086f4c commit c114879
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .changeset/old-penguins-grin.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@
"@hi-ui/hiui": patch
---

feat(form): 修复 validator 回调中第一个参数带有多余的引号
fix(form): 修复 validator 回调中第一个参数带有多余的引号
2 changes: 2 additions & 0 deletions packages/ui/form/src/use-form-field.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,8 @@ export const useFormField = <Values = any>(props: UseFormFieldProps<Values>) =>
// TODO: rules 处理成 Async Validate 的指定结构
const fieldMD5 = stringify(field as FormFieldPath)
const modifiedFieldRules = fieldRules.map((rule) => {
// 重写 rule 的 validator 函数,正则匹配 validatorRule 中的 field 和 fullField,消除 field 和 fullField 中的双引号
// issue:https://github.com/XiaoMi/hiui/issues/2931
if (rule.validator) {
return {
...rule,
Expand Down

0 comments on commit c114879

Please sign in to comment.