Comments (1)
rule 函数的 false
和 string
返回值都表示验证失败。
正确的用法是
() => <boolean 表达式> || '<message>'
这里我猜测你需要比较注册表单中两次重复输入的密码是否相同,那么应该写成这样:
val => form.password === val || t('form.different_passwords_entered_twice')
截图当中的代码不完整,表述也不是很清晰,这个问题我先关闭了。
from slimeform.
Related Issues (12)
- 对于 src/index.ts 的更改建议 HOT 1
- 添加一个计算函数 `isError` 返回整个表单当前是否有错误
- 将 nbsp; 设为默认配置 HOT 6
- Add Markdown linting tools to improve development workflows and experiences
- 集成常用的正则校验库来增强易用性 HOT 3
- Feature request for a `createForm` function or another way to wrap `useForm` HOT 9
- feat(useField): rule checking and status management of fields
- feat(submitter): better submission HOT 1
- Feature Request: disable auto update `status`? HOT 1
- Feature Request: Add `rule` to the return value of `useForm()` HOT 5
- should do verify when component init HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from slimeform.