-
Notifications
You must be signed in to change notification settings - Fork 923
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
[Bug report] vue 项目中,引入 src 目录下的 组件 报错 ts(2307) #1377
Comments
I don't think you have a valid tsconfig, if you want volar to recognize your vue files, you should include them all in tsconfig.json. This is likely (99.9%) to be an issue that you are not configuring your vue vscode extensions well as they require. So you may ask for help in other places, there is no difference a VuePress projects differs from normal vue projects, the only one you should be aware of is that |
兄弟!我知道你英文很好,但是我英文很差,我知道你写英文是为了照顾国外友人,但是中国友人能不能也照顾一下啊。翻译后来的内容有点乱啊.... |
我认为你没有有效的 tsconfig,如果你想让 volar 识别你的 vue 文件,你应该将它们全部包含在 tsconfig.json 中。 这很可能 (99.9%) 是因为您没有按照要求配置 vue vscode 扩展的问题。 所以你可能会在其他地方寻求帮助,VuePress 项目与普通 vue 项目没有区别,你唯一应该注意的是 .vuepress/config.ts 和它导入的其他文件与 vite.config.ts 相同。,应该有 node 环境 (@types/node);而其他文件在浏览器下运行,您应该在 lib 中启用 DOM。 |
非常感谢!你能照顾一下我这个英文很垃圾的中国人。 |
Another thing is that Volar do not auto update analyze in all cases, after editing tsconfig.json, d.ts or something related, you should 另一件事是 Volar 不会在所有情况下自动更新分析,编辑 tsconfig.json、d.ts 或相关内容后,您应该“F1”并输入“volar: restart vue server”。 |
非常感谢!原因找到了。但不知道是 Volar 的原因还是 TS 的规则,当使用 |
This could be helpful to others |
Description
我是在 vue 项目中使用文档,如果引用
docs\.vuepress\components
下的组件是没有问题的但是如果 引入
src\components
下的组件就会报错 ts(2307)Reproduction
https://github.com/WangJincheng4869/fanKuiWenJian/blob/main/vuepress-next-bug.zip
Used Package Manager
pnpm
System Info
The text was updated successfully, but these errors were encountered: