Search code examples
vue.jsvuejs2material-designvue-materialvee-validate

vue-material and vee-validate work together


I tried to make vue-material and vee-validate work together but had some issue. Please see this fiddle

The basic example without material is working but the material design one is not.

  <md-field v-validate="'required|email'" name="email1">
    <label>Email</label>
    <md-input v-model="initial" type="text"></md-input>
     <span>{{ errors.first('email1') }}</span>
  </md-field>

Please advice.


Solution

  • You need to use v-validate on md-input. And add data-vv-name

     <md-input v-model="initial" type="text" v-validate="'required|email'" data-vv-name="email1"></md-input>