我最近开始与 Yup 合作,我的项目中有这个架构,我需要将参数从字符串更改为对象 {string, string}
它是如何(正在工作):
exports.schema = yup.object().shape({
destination: yup.string().required('required msg'),
.....
})
我想成为的样子:
exports.schema = yup.object().shape({
destination: yup.object().shape({
name: string().required('required msg'),
id: string().default(null).nullable()
}).required('required msg'),
....
})
但是在我更改对象后,我一直收到此错误:
参考错误:未定义字符串
我做错了什么?
慕的地6264312
相关分类