-
-
Notifications
You must be signed in to change notification settings - Fork 379
fix: tsx component type declaration #673
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: 内小子 <nbn1209@126.com>
It should be done under a flag. As it provides global types, while this plugin only transform Vue's complication result, which will create misalignment between types and actual behaviour |
@antfu i have an idea.
|
I solved the problem in this way: created a 'components-tsc.d.ts' file manually export {}
declare global {
const NButton: typeof import('naive-ui')['NButton']
} and put it in the tsconfig.json's include prop {
"include": ["env.d.ts", "src/**/*", "src/**/*.vue", "auto-imports.d.ts", "components-tsx.d.ts"],
...
} |
I was curious if there's anything I could do to help get this merged. I've been struggling with types in this way for some time. |
It's been two years, how to solve this problem |
any problems? why this pr put on hold |
Description
make auto imported component work with tsx
Linked Issues
#669
Additional context