Skip to content

Error when validate a custom form #124

Description

@jfrag

Hi,

I just updated BamUI for a project (from 9.x to 10.x).
I have an error when i use the validator plugin.

export default {
  data() {
    return {
      formValidation: {
        validMsg: {},
        validator: useValidator(),
        login: {
          username: {
            label: "Identifiant",
            validator:'required',
          },
          pwd: {
            label: "Mot de passe",
            validator:'required',
          }
        }
      },
      signIn: {
        username: null,
        pwd: null
      }
    }
  },
  methods: {
    login() {
      this.formValidation.validator.set(this.formValidation.login);
      let {valid, validMsg} = this.formValidation.validator.validate(this.signIn);
      this.formValidation.validMsg = validMsg;
      
      if (valid) {
        signInWithEmailAndPassword(auth, this.signIn.username, this.signIn.pwd).then(() => {
          this.$router.push('/')
        }).catch(err => {
          this.$toast(err.message);
        })
      }
    }
  }
}
Uncaught TypeError: Cannot set property openBlock of #<Object> which has only a gette

i don't have the error when i remove the custom validations

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions