Quasar form validation with Vuelidate

$ yarn add vuelidate
$ quasar new boot vuelidate
import Vuelidate from 'vuelidate';

export default ({ Vue }) => {
Vue.use(Vuelidate);
};
<q-input filled
v-model.trim="email"
:label="Your Email..."
@input="$v.email.$touch()"
:rules="[
val => $v.email.required || "Email is required",
val => $v.email.email || "Invalid email format",
]"
/>
import { required, email } from 'vuelidate/lib/validators';

export default {
data() {
return {
email: '',
};
},
validations: {
email: {
required,
email,
},
password: {
required,
},
},
// ...
};

--

--

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store