diff --git a/src/views/AccountManagement/ModalAccountEditCreate.vue b/src/views/AccountManagement/ModalAccountEditCreate.vue index 119848b..fe97800 100644 --- a/src/views/AccountManagement/ModalAccountEditCreate.vue +++ b/src/views/AccountManagement/ModalAccountEditCreate.vue @@ -58,12 +58,13 @@ - - eye + + eye -
acctMgmtStore.currentViewingUser); const isPwdEyeOn = ref(false); const isPwdConfirmEyeOn = ref(false); - const isPwdMatched = ref(true); const isPwdLengthValid = ref(true); const isConfirmDisabled = ref(true); @@ -205,17 +205,13 @@ export default defineComponent({ return modalStore.whichModal === MODAL_CREATE_NEW ? i18next.t('AcctMgmt.CreateNew') : i18next.t('AcctMgmt.AccountEdit'); }); - const togglePwdEyeBtn = () => { - isPwdEyeOn.value = !isPwdEyeOn.value; + const togglePwdEyeBtn = (toBeOpen) => { + isPwdEyeOn.value = toBeOpen; }; const togglePwdConfirmEyeBtn = () => { isPwdConfirmEyeOn.value = !isPwdConfirmEyeOn.value; }; - const validateConfirmPwd = () => { - isPwdMatched.value = inputPwd.value.length > 0 && inputPwd.value === inputConfirmPwd.value; - } - const validatePwdLength = () => { isPwdLengthValid.value = inputPwd.value.length >= PWD_VALID_LENGTH; } @@ -226,12 +222,6 @@ export default defineComponent({ } const onConfirmBtnClick = async () => { - // rule for matching of confirm password - validateConfirmPwd(); - if(!isPwdMatched.value){ - return; - } - // rule for minimum length validatePwdLength(); if(!isPwdLengthValid.value) { @@ -305,7 +295,6 @@ export default defineComponent({ watch( [inputPwd, inputConfirmPwd, inputUserAccount, inputName], ([newPwd, newConfirmPwd, newAccount, newName]) => { - isPwdMatched.value = newPwd === newConfirmPwd && newPwd.length; isPwdLengthValid.value = newPwd.length >= PWD_VALID_LENGTH && newConfirmPwd.length >= PWD_VALID_LENGTH; // 只要[確認密碼]或[密碼]欄位有更動,且所有欄位都不是空的,confirm 按鈕就可點選 if (newPwd.length > 0 && newConfirmPwd.length > 0 && newAccount.length > 0 && newName.length > 0) { @@ -316,6 +305,10 @@ export default defineComponent({ } ); + onMounted(() => { + + }); + return { isConfirmDisabled, username, @@ -325,7 +318,6 @@ export default defineComponent({ isPwdConfirmEyeOn, togglePwdEyeBtn, togglePwdConfirmEyeBtn, - isPwdMatched, isPwdLengthValid, inputUserAccount, inputName,