diff --git a/src/views/profile/agent/index.vue b/src/views/profile/agent/index.vue index 7e427a5..7d35db5 100644 --- a/src/views/profile/agent/index.vue +++ b/src/views/profile/agent/index.vue @@ -26,8 +26,8 @@ 编辑 - - + + 调整金额 diff --git a/src/views/user/Login.vue b/src/views/user/Login.vue index 6267472..f922594 100644 --- a/src/views/user/Login.vue +++ b/src/views/user/Login.vue @@ -14,7 +14,7 @@ v-for="tab in tabList" :key="tab.name" :class="['tab-item', { active: activeTab === tab.name }]" - @click="activeTab = tab.name" + @click="switchTab(tab.name)" > {{ tab.label }} @@ -121,6 +121,18 @@ const rules: FormRules = { ], } +// 切换登录方式:清空输入框并重置表单校验 +function switchTab(name: string) { + if (activeTab.value === name) return + activeTab.value = name + // 清空邮箱、手机号、密码 + loginForm.value.email = '' + loginForm.value.phone = '' + loginForm.value.password = '' + // 重置表单校验状态,清除错误提示 + loginFormRef.value?.clearValidate() +} + // 弹窗相关 const dialogVisible = ref(false) const dialogTitle = ref('')