📜  是的密码确认密码 - 任何代码示例

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

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