Skip to content

配置自动导入 vue 导致 Ref 等类型在 ts 文件中使用时使 IDE 失去了导入提示 #608

@WangJincheng4869

Description

@WangJincheng4869

Describe the bug

这个问题的根源应该是 Ref 等类型的自动导入无法在 ts 文件中使用,需要进行手动导入,手动导入又使 IDE 失去了导入提示功能。

在 ts 中可以不进行类型的自动导入,但是一定保留 IDE 的导入提示功能

Reproduction

https://github.com/WangJincheng4869/fanKuiWenJian/tree/main/packages/vite-auto-imports

System Info

System:
    OS: Windows 11 10.0.26200
    CPU: (16) x64 AMD Ryzen 9 7940H  w/ Radeon 780M Graphics     
    Memory: 12.03 GB / 31.22 GB
  Binaries:
    Node: 22.17.1 - D:\Program Files\nodejs\node.EXE
    npm: 10.9.2 - D:\Program Files\nodejs\npm.CMD
    pnpm: 10.17.1 - D:\Users\jcwang\AppData\Roaming\npm\pnpm.CMD
  Browsers:
    Edge: Chromium (141.0.3537.99)
    Internet Explorer: 11.0.26100.1882

Used Package Manager

pnpm

Validations

  • Follow our Code of Conduct
  • Read the Contributing Guide.
  • Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
  • Check that this is a concrete bug. For Q&A, please open a GitHub Discussion instead.
  • The provided reproduction is a minimal reproducible of the bug.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions