required
required([strict=false])
作用
限制被检测值不为undefined | null | NaN
.
若开启严格模式(strict=true), 则被检测值不允许为undefined | null | NaN | '' | {} | []
。
参数
[strict]
(boolean) - 是否开启严格模式,可不传,默认为false
不开启。若明确设置strict=true
则开启严格模式。
示例
最后更新于
这有帮助吗?
required([strict=false])
限制被检测值不为undefined | null | NaN
.
若开启严格模式(strict=true), 则被检测值不允许为undefined | null | NaN | '' | {} | []
。
[strict]
(boolean) - 是否开启严格模式,可不传,默认为false
不开启。若明确设置strict=true
则开启严格模式。
最后更新于
这有帮助吗?