Using Vuetify form validation, validation error message not getting displayed.
I am using Vue.js, Vuetify and TypeScript. I was trying to validate a form but my validation messages are not getting displayed. Though the field is turning to red. I can also see the error func getting called
<template>
<v-layout row justify-center>
<v-dialog v-model="show" persistent max-width="600px">
<v-card>
<v-card-title>
<span class="headline">Testing validations</span>
</v-card-title>
<v-card-text>
<v-container grid-list-md>
<v-form v-model="form.valid" ref="form">
<v-layout wrap>
<v-flex xs12>
<v-text-field
label="Checklist Name"
v-model="list.name"
:rules="[errorFunc]"
name="checklist"
></v-text-field>
</v-flex>
</v-layout>
</v-form>
</v-container>
</v-card-text>
<v-card-actions>
<v-spacer></v-spacer>
<v-btn color="blue darken-1" flat @click="add">Save</v-btn>
<v-btn color="blue darken-1" flat @click="show = false">Close</v-btn>
</v-card-actions>
</v-card>
</v-dialog>
</v-layout>
</template>
<script lang="ts">
import { Component, Prop, Vue } from "vue-property-decorator";
@Component({
components: {}
})
export default class listForm extends Vue {
@Prop() visible!: boolean;
form = {
valid: false
};
list = {
name: ""
};
errorFunc() {
let val: any;
if (this.list.name.length >= 3) {
val = true;
} else {
val = "Errorrrr";
}
console.log(val);
return val;
}
get show() {
return this.visible;
}
set show(value) {
if (!value) {
this.$emit("close");
}
}
add() {
if (this.$refs.form.validate()) {
this.$emit("save", this.list);
}
}
}
</script>
I am not sure why I am not able to see the validation error message.


