vue单页面 el-form一打开就校验

vue单页面应用,在nextTick回调函数中获取

 // 获取详情
    getUserInfo() {
      this.$nextTick(async () => {
        let res = await this.$request("getInfo", {}, this.Id);
        this.form.id = res.id; 
        // 重置表单内容,清空验证
        this.$refs["form"].resetFields();
        // 不重置表单内容,只清空验证
        this.$refs['form'].clearValidate() 
      });
    },

猜你喜欢

转载自blog.csdn.net/future_1_/article/details/128221341