save
This commit is contained in:
@@ -197,7 +197,7 @@ export default defineComponent({
|
|||||||
return modalStore.whichModal === MODAL_CREATE_NEW ? i18next.t('AcctMgmt.CreateNew') : i18next.t('AcctMgmt.AccountEdit');
|
return modalStore.whichModal === MODAL_CREATE_NEW ? i18next.t('AcctMgmt.CreateNew') : i18next.t('AcctMgmt.AccountEdit');
|
||||||
});
|
});
|
||||||
|
|
||||||
const validateInputLengthAndEquality = (inputAccountToTest, inputNameToTest, inputPasswordToTest, inputConfirmPwdToTest, inputPwdMatchedToTest,
|
const shouldDisalbeConfirmButton = (inputAccountToTest, inputNameToTest, inputPasswordToTest, inputConfirmPwdToTest, inputPwdMatchedToTest,
|
||||||
) => {
|
) => {
|
||||||
return !inputAccountToTest?.length || !inputNameToTest?.length || !inputPasswordToTest?.length
|
return !inputAccountToTest?.length || !inputNameToTest?.length || !inputPasswordToTest?.length
|
||||||
|| !inputConfirmPwdToTest?.length || !inputPwdMatchedToTest;
|
|| !inputConfirmPwdToTest?.length || !inputPwdMatchedToTest;
|
||||||
@@ -287,11 +287,11 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onMounted(() => {
|
onMounted(() => {
|
||||||
watch(
|
watch(
|
||||||
[inputUserAccount, inputName, inputPwd, inputConfirmPwd, isPwdMatched],
|
[inputUserAccount, inputName, inputPwd, inputConfirmPwd, isPwdMatched],
|
||||||
([newAccount, newName, newPwd, newConfirmPwd, newPwdMatched]) => {
|
([newAccount, newName, newPwd, newConfirmPwd, newPwdMatched]) => {
|
||||||
if (validateInputLengthAndEquality(newAccount, newName, newPwd, newConfirmPwd, newPwdMatched)) {
|
if (shouldDisalbeConfirmButton(newAccount, newName, newPwd, newConfirmPwd, newPwdMatched)) {
|
||||||
isConfirmDisabled.value = true;
|
isConfirmDisabled.value = true;
|
||||||
} else {
|
} else {
|
||||||
isConfirmDisabled.value = false;
|
isConfirmDisabled.value = false;
|
||||||
@@ -299,6 +299,13 @@ export default defineComponent({
|
|||||||
},
|
},
|
||||||
{ immediate: true }
|
{ immediate: true }
|
||||||
);
|
);
|
||||||
|
|
||||||
|
watch(
|
||||||
|
[inputPwd, inputConfirmPwd],
|
||||||
|
([newPwd, newConfirmPwd]) => {
|
||||||
|
isPwdMatched.value = newPwd === newConfirmPwd && newPwd.length;
|
||||||
|
}
|
||||||
|
)
|
||||||
});
|
});
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
|||||||
Reference in New Issue
Block a user