supporting validation evaluations #34872 (#37907)

This commit is contained in:
Jan Esser
2019-08-26 08:00:58 -07:00
committed by Sheetal Nandi
parent 5ce56f2206
commit b3a186fcab
2 changed files with 11 additions and 1 deletions
+5 -1
View File
@@ -6,13 +6,17 @@ import { Validation } from './vuelidate'
declare module 'vue/types/vue' {
type ValidationProperties<V> = {
[P in keyof V]?: Validation & ValidationProperties<V[P]>
[P in keyof V]?: Validation & ValidationProperties<V[P]> & ValidationEvaluation
}
interface ValidationGroups {
[groupName: string]: Validation & ValidationProperties<any>
}
interface ValidationEvaluation {
[ruleName: string]: boolean
}
interface Vue {
$v: ValidationProperties<this> & ValidationGroups & Validation
+6
View File
@@ -166,6 +166,12 @@ export class ValidComponent extends Vue {
get isRepoValid() {
return !this.$v.$invalid
}
get isPasswordLengthOk() {
if (this.$v.password) {
return !this.$v.password.minLength
} else return false
}
}
@Component({