使用TinyForm物料,如何实现表单的自定义校验呢 #377
Unanswered
FairyShuai
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
例如我想实现自定义校验,如果直接在代码中,可以这样使用
{ validator: (rule, value, cb) => (/^1(3[0-9]|4[01456879]|5[0-35-9]|6[2567]|7[0-8]|8[0-9]|9[0-35-9])d{8}$/.test(value) ? cb() : cb(new Error('手机号格式错误'))), trigger: 'change' }
但是在低代码工具中,直接给表单rule组件赋值,出码后validator的值会变成字符串,请问如何给表单添加自定义校验函数呢
Beta Was this translation helpful? Give feedback.
All reactions