[FEATURE]Form bindsuccess 回调里能否带上参与校验的 props ?

Open
#174 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
2/5
Estimated time
1-3 hours
Newbie friendliness
58/100
Issue type
Feature
Clarity
Clearly specified
Activity status
Stale
Tech stack
typescript
Domain
frontend

Research direction

Start at src/form/form.ts around line 94 and trace how the bindsuccess callback is assembled after validation. Update the callback data so it includes the prop names of the fields involved in validation, then verify that the emitted result matches the requested array shape.

Written by the indexing model from the issue text.

Description

遇到的问题

因为bindsuccess/bindfail回调只校验models中改变了的字段,而不是所有字段,组件外部需要知道校验的是哪些字段,用于显示相应字段的校验状态。

https://github.com/wechat-miniprogram/weui-miniprogram/blob/6cb2073e465b49a921fce73657be1faf165e8f6a/src/form/form.ts#L94

特性方案

bindsuccess回调中带上参与校验的字段名称(prop)数组。

Dominant language
TypeScript
Stars
2.4k
Forks
549
PR merge metrics
No merged PRs in 30d

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from wechat-miniprogram/weui-miniprogram

All issues in wechat-miniprogram/weui-miniprogram

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.