Closed Jacknq closed 7 years ago
You need to roll out your own decorator. Otherwise, you can just put validations in @Component({validattions: {}})
im in av-ts 6.3 last compatible with kilimanjaro If I put it in component I get:
error TS2345: Argument of type '{ validations: { username: { required: any; minLength: any; }; }; }' is not assignable to param
eter of type 'ComponentOptions<Vue>'.
Object literal may only specify known properties, and 'validations' does not exist in type 'ComponentOptions<Vue>'.
@Component({
validations: {
username: {
required,
minLength: minLength(4)
}
}
})
You need to extend vue's ComponentOption type.
https://github.com/HerringtonDarkholme/av-ts/wiki/FAQ#3-componentmeta-augmentation
ok, Thanks.
hi, lets say I want to use some lib that comes with regular vue like validation (vuelidate) which extends vue and its outside of data. How to simulate same behavior on your component, if its prop or data its not found.
https://monterail.github.io/vuelidate/#sub-basic-form