MForm (.MFORM)

A Vue form wrapper to do the final validation check on your form (supports Mairs input components only).

Usage

Wrap your inputs in this MForm component then do a validation check on all of them by calling the method checkValidation().

<template>
  <MForm ref="myForm" @submit="handleSubmit()">
    <MInput id="MInput" :pattern="/^[a-z]{1}\w{2,}$/" v-model="username" />
  </MForm>
</template>

<script>
export default {
  methods: {
    handleSubmit() {
      if (this.$refs.myForm.checkValidation()) {
        // Do your submit here
      }
    },
  },
};
</script>