mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-06 15:57:13 +00:00
Vendored
+5
-1
@@ -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
|
||||
|
||||
|
||||
@@ -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({
|
||||
|
||||
Reference in New Issue
Block a user