这个写法被弃用了
来源:3-4 如何自定义关键字

qq_夲宫_9o後_0
2021-10-16
ajv.addKeyword('test', {
validate(schema, data) {
if (schema === true) return true
else return schema.length === 6
},
errors: false
})
虽然可以正常校验,但是控制台会多一行提示:
these parameters are deprecated, see docs for addKeyword
所以,需要修改一下
ajv.addKeyword({
keyword: 'test',
validate(schema, data) {
if (schema === true) return true
else return schema.length === 6
},
errors: false
})
写回答
2回答
-
Jokcy
2021-10-19
如果跟课程学的建议使用ajv6
00 -
慕仰5486833
2021-10-18
xd,你ajv版本号是多少
022021-10-19
相似问题