两个表单之间tab选项切换时,总会触发密码校验

1、我也不知道原因是什么,找了半天不知道为什么会触发,所以我在点击切换的时候做了清空表单校验
2、直接上代码

loginOrRegister(val) {
    
      // 方法
  if(val) {
    
    
    this.isActive = true
    this.$nextTick(async () => {
    
     // 一定要使用nextTick,要不然还没渲染出来,会显示undefined
      await this.$refs['loginFormRef'].clearValidate()  //  清空校验规则
    })
    return
  }
  this.isActive = false
  this.$nextTick(async () => {
    
    
    await this.$refs['registerFormRef'].clearValidate()
  })
},

猜你喜欢

转载自blog.csdn.net/weixin_44949068/article/details/131049777
今日推荐