组合
与 And
使用 and
来组合两个验证规则,只有当两个规则都通过时才是通过
v.val(50, ">18 and <60"); // true
v.val(70, ">18 and <60"); // false
或 Or
使用 or
来组合两个验证规则,只要有一个通过就认为是通过了
v.val(50, "<18 or >60"); // false
v.val(70, "<18 or >60"); // true
否 Not
使用 not()
来翻转一个规则的结果,将 true
变为 false
,false
变为 true
v.val(50, "not(>60)); // true
Last updated
Was this helpful?