📜  是的,验证密码确认 - Javascript 代码示例

📅  最后修改于: 2022-03-11 15:02:20.385000             🧑  作者: Mango

代码示例4
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
    })
})