Mobx 反应表单确认密码问题
Mobx react form confirm password issue
我正在使用 mobx-react-form (https://foxhound87.github.io/mobx-react-form/docs/getting-started-class.html) 并且我有这样的密码规则验证,但是无论我在确认字段之外点击,确认密码错误都会出现2 个值完全相同:
{
name: 'changePassword',
label: 'Change password',
fields: [
{
name: 'password',
label: t('user:Password'),
rules: 'required|string|min:8',
value: ''
},
{
name: 'password2',
label: t('user:Confirm password'),
rules: 'required|string|same:password',
value: ''
}
]
},
根据文档,这应该按预期工作。
没有发现更改密码部分是嵌套的:
{
name: 'changePassword',
label: 'Change password',
fields: [
{
name: 'password',
label: t('user:Password'),
rules: 'required|string|min:8',
value: ''
},
{
name: 'password2',
label: t('user:Confirm password'),
rules: 'required|string|same:changePassword.password',
value: ''
}
]
},
我正在使用 mobx-react-form (https://foxhound87.github.io/mobx-react-form/docs/getting-started-class.html) 并且我有这样的密码规则验证,但是无论我在确认字段之外点击,确认密码错误都会出现2 个值完全相同:
{
name: 'changePassword',
label: 'Change password',
fields: [
{
name: 'password',
label: t('user:Password'),
rules: 'required|string|min:8',
value: ''
},
{
name: 'password2',
label: t('user:Confirm password'),
rules: 'required|string|same:password',
value: ''
}
]
},
根据文档,这应该按预期工作。
没有发现更改密码部分是嵌套的:
{
name: 'changePassword',
label: 'Change password',
fields: [
{
name: 'password',
label: t('user:Password'),
rules: 'required|string|min:8',
value: ''
},
{
name: 'password2',
label: t('user:Confirm password'),
rules: 'required|string|same:changePassword.password',
value: ''
}
]
},