Closed WangJincheng4869 closed 1 year ago
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 .vuepress/config.ts
and other files it's importing is the same as vite.config.ts
which should have node env(@types/node), while other files are running under browsers, which you should enable DOM lib.
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.
我尝试加入 docs/**/*.vue
但是没用啊
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
.vuepress/config.ts
and other files it's importing is the same asvite.config.ts
which should have node env(@types/node), while other files are running under browsers, which you should enable DOM lib.
兄弟!我知道你英文很好,但是我英文很差,我知道你写英文是为了照顾国外友人,但是中国友人能不能也照顾一下啊。翻译后来的内容有点乱啊....
我认为你没有有效的 tsconfig,如果你想让 volar 识别你的 vue 文件,你应该将它们全部包含在 tsconfig.json 中。
这很可能 (99.9%) 是因为您没有按照要求配置 vue vscode 扩展的问题。 所以你可能会在其他地方寻求帮助,VuePress 项目与普通 vue 项目没有区别,你唯一应该注意的是 .vuepress/config.ts 和它导入的其他文件与 vite.config.ts 相同。,应该有 node 环境 (@types/node);而其他文件在浏览器下运行,您应该在 lib 中启用 DOM。
我认为你没有有效的 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 F1
and type volar: restart vue server
.
另一件事是 Volar 不会在所有情况下自动更新分析,编辑 tsconfig.json、d.ts 或相关内容后,您应该“F1”并输入“volar: restart vue server”。
Another thing is that Volar do not auto update analyze in all cases, after editing tsconfig.json, d.ts or something related, you should
F1
and typevolar: restart vue server
.另一件事是 Volar 不会在所有情况下自动更新分析,编辑 tsconfig.json、d.ts 或相关内容后,您应该“F1”并输入“volar: restart vue server”。
非常感谢!原因找到了。但不知道是 Volar 的原因还是 TS 的规则,当使用 docs/**/*.vue
配置时,里面目录名使用 .
开头的都不识别,只要配置为 docs/.vuepress/**/*.vue
就可以了。
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