Open lishaobos opened 11 months ago
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"],
...
}
Description
make auto imported component work with tsx
Linked Issues
https://github.com/antfu/unplugin-vue-components/issues/669
Additional context