-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Property 'X' does not exist on type CombinedVueInstance using TypeScript Prop Validator #8679
Comments
Typescript bug? |
@KaelWD That works! But why? |
¯\_(ツ)_/¯ They both have the same type signature, so no idea. I'd try to reproduce it without vue and open an issue on https://github.com/Microsoft/TypeScript |
if you do delay: {
default: 600,
type: Number ,
validator(value:number){
return value >= 0;
}
} as PropOptions<number> seems to be working, typescript seems not picking up the type |
Ran into this issue yesterday and @pikax suggestion fixed this for me. I didn't know about |
I had this happen with a Date prop. If I had just the type, it was ok:
But when I added a default value, everything broke in the component:
Unless you cast the object like mentioned above:
For anyone googling the seemingly unrelated error, you will get this for every property in your component:
|
leads to eslint error
but I do not want to switch off
|
try |
Version
2.5.16
Reproduction link
https://codepen.io/muhammadrehansaeed/pen/XPWKyJ
Steps to reproduce
Use Typescript to build this component:
What is expected?
The component builds.
What is actually happening?
The following error is thrown:
If I remove the validator from the prop, the error goes away. If I remove the data section, the error also goes away.
The text was updated successfully, but these errors were encountered: