📜  是的密码验证 - 任何代码示例

📅  最后修改于: 2022-03-11 14:57:26.845000             🧑  作者: Mango

代码示例5
Yup.object({
  password: Yup.string().required('Password is required'),
  passwordConfirmation: Yup.string()
    .test('passwords-match', 'Passwords must match', function(value){
      return this.parent.password === value
    })
})