-
-
Notifications
You must be signed in to change notification settings - Fork 431
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
fix(language-core): correctly infer union props to options #4908
Conversation
vue-component-meta
vue-component-type-helpers
@vue/language-core
@vue/language-plugin-pug
@vue/language-server
@vue/language-service
vue-tsc
@vue/typescript-plugin
commit: |
Thanks, I've tested your patch and it fixed my issue. |
@KazariEX I think this would be a great addition. Currently there are typescript errors when you do the following:
As soon as you add the style module tag, vue and typescript are unable to properly see props and things like imported components. I tested your code locally and it seemed to have made the typescript errors in the template tag go away immediately. Do you think it makes sense to reconsider this PR? |
According to Johnson's suggestion, a better approach is to place union types into generics to skip redundant type inferring and directly use the original types, which avoids injecting too much difficult to maintain code. |
There are many issues with that approach. I started writing a comment about that but then I stumbled upon an even bigger bug regarding union props and unfortunately I still have to file it. |
I did try the generics approach as well, but that does cause other issues for me as well. I'll try to create a minimal component reproduction of the errors I'm encountering with it and post it here. |
fix vuejs/core#12012 , fix vuejs/core#12110