Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

fix: tsx component type declaration#673

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Open
lishaobos wants to merge4 commits intounplugin:main
base:main
Choose a base branch
Loading
fromlishaobos:tsx

Conversation

lishaobos
Copy link
Contributor

Description

make auto imported component work with tsx

Linked Issues

#669

Additional context

eiinu and whaaaley reacted with thumbs up emoji
@antfu
Copy link
Member

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

@lishaobos
Copy link
ContributorAuthor

lishaobos commentedAug 8, 2023
edited
Loading

@antfu i have an idea.

  1. add options.dtsGlobal: boolean
  2. add options.dts type: boolean | string | { path: string; global: boolean }

@cmdyu
Copy link

I solved the problem in this way:

created a 'components-tsc.d.ts' file manually

export{}declareglobal{constNButton:typeofimport('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"],  ...}

@whaaaley
Copy link

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.

@wjp980108
Copy link

It's been two years, how to solve this problem

@cangSDARM
Copy link

any problems? why this pr put on hold

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@antfuantfuAwaiting requested review from antfuantfu is a code owner

@nabaonannabaonanAwaiting requested review from nabaonan

Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

9 participants
@lishaobos@antfu@cmdyu@whaaaley@wjp980108@cangSDARM@fengxiaodong28@CCherry07@nabaonan

[8]ページ先頭

©2009-2025 Movatter.jp