From 89be2fcb63907da846fdf5f87ca69b226cd2f33e Mon Sep 17 00:00:00 2001 From: username <2971861643@qq.com> Date: Sat, 27 Apr 2024 21:12:23 +0800 Subject: [PATCH] 11 --- src/views/Login.vue | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/views/Login.vue b/src/views/Login.vue index 74cc485..4758301 100644 --- a/src/views/Login.vue +++ b/src/views/Login.vue @@ -133,24 +133,24 @@ export default { register() { if (this.create) { // 从注册切换到登录清空表单内容 - this.form.username = ""; - this.form.password = ""; - this.form.repassword = ""; + this.form.username = "" + this.form.password = "" + this.form.repassword = "" } else if ( this.form.username || this.form.password || this.form.repassword ) { // 从登录切换到注册清空表单内容 - this.form.username = ""; - this.form.password = ""; - this.form.repassword = ""; + this.form.username = "" + this.form.password = "" + this.form.repassword = "" } - this.create = !this.create; + this.create = !this.create // 清除字段的验证错误 - this.$refs.form.clearValidate("username"); - this.$refs.form.clearValidate("password"); - this.$refs.form.clearValidate("repassword"); + this.$refs.form.clearValidate("username") + this.$refs.form.clearValidate("password") + this.$refs.form.clearValidate("repassword") }, }, };