Can this work with typescript
Closed this issue · 3 comments
Any idea how to make this work with Typescript? For some reason in my project when I load this as a mixin with typescript nothing happens.
I also tried wrapping it in my own mixin like this:
import vmv from 'vuejs-model-validator'
@Mixin
export default class ValidationMixin extends Vue {
beforeMount () {
vmv.beforeMount()
}
destroyed () {
vmv.destroyed()
}
}
but it throws an error "TypeError: Cannot read property 'validations' of undefined"
Is there another way I can load this in my component without a mixin something like "vmv.init(this)" ?
AFAIK shouldnt cause you any troble but my knowledge about creating typescript packages is quite limited.
Just stupid question... did you define the object validations in the vue component where you want to validate?
If so, could you please provide me with a repo that I can clone and do some testings?
Regards!
Another dev on my team got it working, not sure exactly how
Oh, in that case if there is anything I can include in the code to make it easier to use for typescript people let me know and I will update it.