Skip to content
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

Options api type issue #3690

Open
zam157 opened this issue Oct 26, 2023 · 7 comments
Open

Options api type issue #3690

zam157 opened this issue Oct 26, 2023 · 7 comments
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first 🔨 p3-minor-bug upstream

Comments

@zam157
Copy link

zam157 commented Oct 26, 2023

Vue Playground

If i set some props to App.vue, the type of Comp.vue in App.vue's template is any, comment out the prop related code the type of the Comp.vue is fine

Not sure if this is related to vue core type

image

image

@so1ve so1ve added bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first labels Oct 26, 2023
@so1ve
Copy link
Member

so1ve commented Oct 26, 2023

Indeed this is a vue core type issue

@zam157
Copy link
Author

zam157 commented Oct 27, 2023

Indeed this is a vue core type issue

I'll make a copy issue there later

@so1ve
Copy link
Member

so1ve commented Oct 27, 2023

vuejs/core#9296

@zam157
Copy link
Author

zam157 commented Oct 27, 2023

Oh sorry I didn't find out that you have already created that issue

@zam157
Copy link
Author

zam157 commented Nov 18, 2023

TS Language Server behaves differently in js and ts:

image

image

In .js files, it seens like unknown or void will be automatically converted to any, and it dosen't match the function overloading type of defineComponent

workaround:
pnpm patch "@vue/runtime-core" then add some new function overloading types for defineComponent to handle this situation

Vue Playground

image

image

@rchl
Copy link
Collaborator

rchl commented Nov 18, 2023

TS Language Server performs not the same between .ts and .js files:

yeah, as @so1ve mentioned in #3690 (comment)

@zam157
Copy link
Author

zam157 commented Nov 18, 2023

TS Language Server performs not the same between .ts and .js files:

yeah, as @so1ve mentioned in #3690 (comment)

I know, just add some detail and workaround for this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good reproduction ✨ This issue provides a good reproduction, we will be able to investigate it first 🔨 p3-minor-bug upstream
Projects
None yet
Development

No branches or pull requests

5 participants