fix: #319 add watch of inputConfirmPwd inside onMounted

This commit is contained in:
Cindy Chang
2024-07-10 10:40:15 +08:00
parent b70f241ab5
commit bba7f24672
2 changed files with 31 additions and 2 deletions

View File

@@ -199,9 +199,28 @@ export default defineComponent({
const shouldDisalbeConfirmButton = (inputAccountToTest, inputNameToTest, inputPasswordToTest, inputConfirmPwdToTest, inputPwdMatchedToTest,
) => {
console.log('inputAccountToTest?.length', inputAccountToTest?.length);
return !inputAccountToTest?.length || !inputNameToTest?.length || !inputPasswordToTest?.length
|| !inputConfirmPwdToTest?.length || !inputPwdMatchedToTest;
}
// watch( TODO:暫時註解
// [inputUserAccount, inputName, inputPwd, inputConfirmPwd,
// isPwdMatched,
// ],
// async ([newAccount, newName, newPwd, newConfirmPwd,
// newPwdMatched,
// ]) => {
// if (validateInputLengthAndEquality(newAccount, newName, newPwd, newConfirmPwd, newPwdMatched)) {
// isConfirmDisabled.value = true;
// } else {
// isConfirmDisabled.value = false;
// }
// },
// { immediate: true }
// );
const togglePwdEyeBtn = () => {
isPwdEyeOn.value = !isPwdEyeOn.value;
@@ -279,6 +298,17 @@ export default defineComponent({
}
}
const onInputAccountFocus = async() => {
// if(!isAccountUnique.value) {
// // 之所以要轉回true是為了讓使用者可以繼續填寫不被阻擋
// isAccountUnique.value = true;
// }
// if(isConfirmDisabled.value){
// // 所有欄位都要填寫confirm按鈕才可點選
// if(validateInputLengthAndEquality(inputUserAccount.value, inputName.value, inputPwd.value, inputConfirmPwd.value, isPwdMatched.value)
// ){
// isConfirmDisabled.value = false;
// }
// }
}
const onInputNameFocus = () => {