I created a plugin object for the regex I use in my app so I can use them in a global way. Something like this:
import Vue from "vue";
Vue.prototype.$regex = {
//isEmail function here
}
In javascript this code works. However in my new typescript project once I do:
methods: {
isEmail(string: string): boolean {
return this.$regex.isEmail(string)
}
}
I get:
Property '$regex' does not exist on type 'CombinedVueInstance<Vue...
What's the correct way of using my plugin in a Vue.js 2 with typescript project?