安装
npm install @zhiq1/rules
使用
import { RuleRegExp, RuleValidateFn, RuleUtils } from '@zhiq1/rules'
const rules = {
name: [
{ pattern: RuleRegExp.Variable, trigger: 'blur' }
],
age: [
{ validator: RuleValidateFn.checkNum({min: 0, max: 200, isInt: true, notNull: true }), trigger: 'blur' }
]
}