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

Missing defineComponent() in components breaks VS Code Intellisense support #841

Closed
boonyasukd opened this issue Dec 4, 2020 · 3 comments · Fixed by #849
Closed

Missing defineComponent() in components breaks VS Code Intellisense support #841

boonyasukd opened this issue Dec 4, 2020 · 3 comments · Fixed by #849
Assignees
Labels
Project::Bug Something isn't working Quality::TypeScript Related this issue is related to type definition

Comments

@boonyasukd
Copy link

I'm currently migrating codebase with VS Code with Volar, which Evan suggested his team to use instead of Vetur "for now" (at least until Vetur is fully up-to-date with Vue 3).

While developing, I found that Intellisense inside <template> section doesn't work on some of the element-plus' components. After inspecting the source code, these components seem to directly export plain objects instead of wrapping with defineComponent() first before returning. For example, ElMenu code uses defineComponent(), while ElSubmenu and ElMenuItem return plain objects, the Intellisense is broken on the latter two:

image

Searching through the codebase, right now there seems to be 10 components that don't use defineComponent() yet:

image

It'd be great if you can fix these components to be compatible with VS Code. Thank you.

@jw-foss
Copy link
Member

jw-foss commented Dec 5, 2020

Thank you for bringing this up, I promise that we will get this fixed ASAP!

@jw-foss jw-foss self-assigned this Dec 5, 2020
@jw-foss jw-foss added Project::Bug Something isn't working Quality::TypeScript Related this issue is related to type definition labels Dec 5, 2020
@jw-foss
Copy link
Member

jw-foss commented Dec 5, 2020

I dunno whether the current fix in #849 is going to fix all the problems in Volar, please give us feedback when you get errors. I am at your service.

@boonyasukd
Copy link
Author

@JeremyWuuuuu Thank you for the quick fix. I will test and give a feedback.

SimonaliaChen pushed a commit that referenced this issue Dec 6, 2020
- Using `defineComponent` to wrap component up for Volar support, this should close #841
- Also made changes for some typing
- Removed `merge.ts` since `Object.assign` are now supported natively
@github-actions github-actions bot locked and limited conversation to collaborators Dec 13, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Project::Bug Something isn't working Quality::TypeScript Related this issue is related to type definition
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants