refine close modal time
This commit is contained in:
@@ -13,8 +13,9 @@ export const useModalStore = defineStore('modalStore', {
|
|||||||
this.whichModal = whichModal;
|
this.whichModal = whichModal;
|
||||||
},
|
},
|
||||||
async closeModal(){
|
async closeModal(){
|
||||||
await delaySecond(2);
|
console.log("Start closing modal");
|
||||||
this.isModalOpen = false;
|
this.isModalOpen = false;
|
||||||
|
console.log("Modal closed");
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
@@ -199,28 +199,9 @@ export default defineComponent({
|
|||||||
|
|
||||||
const validateInputLengthAndEquality = (inputAccountToTest, inputNameToTest, inputPasswordToTest, inputConfirmPwdToTest, inputPwdMatchedToTest,
|
const validateInputLengthAndEquality = (inputAccountToTest, inputNameToTest, inputPasswordToTest, inputConfirmPwdToTest, inputPwdMatchedToTest,
|
||||||
) => {
|
) => {
|
||||||
console.log('inputAccountToTest?.length', inputAccountToTest?.length);
|
|
||||||
return !inputAccountToTest?.length || !inputNameToTest?.length || !inputPasswordToTest?.length
|
return !inputAccountToTest?.length || !inputNameToTest?.length || !inputPasswordToTest?.length
|
||||||
|| !inputConfirmPwdToTest?.length || !inputPwdMatchedToTest;
|
|| !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 = () => {
|
const togglePwdEyeBtn = () => {
|
||||||
isPwdEyeOn.value = !isPwdEyeOn.value;
|
isPwdEyeOn.value = !isPwdEyeOn.value;
|
||||||
@@ -298,17 +279,6 @@ export default defineComponent({
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
const onInputAccountFocus = async() => {
|
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 = () => {
|
const onInputNameFocus = () => {
|
||||||
@@ -317,7 +287,7 @@ 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]) => {
|
||||||
|
|||||||
Reference in New Issue
Block a user