UNPKG

ren-framework

Version:
34 lines (28 loc) 490 B
'use strict' const Validator = require('../base/Validator'); /** * 必须校验器 * @author Verdient。 */ class RequiredValidator extends Validator { /** * @inheritdoc * @author Verdient。 */ initProperty(){ super.initProperty(); /** * @property 是否必须 * @author Verdient。 */ this.required = true; /** * @property 提示信息 * @author Verdient。 */ this.message = this.empty; return this; } } module.exports = RequiredValidator;