Skip to content

Commit

Permalink
perf(check): perf check on button
Browse files Browse the repository at this point in the history
  • Loading branch information
xixiIBN5100 committed Nov 3, 2024
1 parent 15a91b6 commit fb1ccba
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions src/pages/setting/changePassword/index.vue
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
{{ warnText }}
</text>
<template #footer>
<w-button block @tap="formCheck(true)">
<w-button block @tap="handleConfirm">
确认修改
</w-button>
</template>
Expand Down Expand Up @@ -76,7 +76,7 @@ const isShowConfirm = ref(false);
const showWarning = ref(false);
const warnText = ref("");
const formCheck = (clickButton?: boolean) => {
const formCheck = () => {
if (password.value === "" || passwordAgain.value === "") return;
if (password.value.length < 6 || password.value.length > 20) {
warnText.value = "密码长度必须在6~20位之间";
Expand All @@ -89,9 +89,11 @@ const formCheck = (clickButton?: boolean) => {
return;
}
showWarning.value = false;
if (clickButton && !showWarning.value) {
isShowConfirm.value = true;
}
};
const handleConfirm = () => {
formCheck();
isShowConfirm.value = true;
};
const changePasswordClick = () => {
isShowConfirm.value = false;
Expand Down

0 comments on commit fb1ccba

Please sign in to comment.