RebbVal
CN
CN
  • 快速上手
  • 概述
  • 概念
  • 规则列表
    • 年龄
    • 数组
    • 布尔
    • 比较
    • 组合
    • 日期时间
    • 标识码
    • 互联网
    • 地区相关
    • 字符串
Powered by GitBook
On this page
  • 与 And
  • 或 Or
  • 否 Not

Was this helpful?

  1. 规则列表

组合

与 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

当前版本的RebbVal 不支持使用not 来翻转一个规则组合,也就是说你不能这样做:

v.val(50,"not(<18 or >60)"); // not supported

Previous比较Next日期时间

Last updated 4 years ago

Was this helpful?