error
error(message, [ctx])
作用
使用方式
参数
示例
const schema = racoon
.string()
.error('姓名必须为字符串')
.required()
.error('姓名不能为空');
schema.validate(1); // fail, 错误信息为 '姓名必须为字符串'
schema.validate(null); // fail, 错误信息为 '姓名不能为空'最后更新于