Vetur找不到tsconfig或者jsconfig配置文件
vetur
官网:https://vuejs.github.io/vetur/,下图是这个插件的特点,暂时用到语法高亮
如下图,VsCode提示没有配置tsconfig.json或者jsconfig.js
点击"Learn More"进入到了Vetur的官网,根据它的意思是,要不我们添加对应的配置,要不就关闭这个提示
添加jsconfig.json配置
在项目新建vetur.config.js,添加如下配置即可: // vetur.config.js /** @type {import("vls").VeturConfig} */ module.exports = { // **optional** default: `{}` // override vscode settings // Notice: It only affects the settings used by Vetur. settings: { "vetur.useWorkspaceDependencies": true, "vetur.experimental.templateInterpolationService": true }, // **optional** default: `[{ root: "./" }]` // support monorepos projects: [ "./packages/repo2", // shorthand for only root. { // **required** // Where is your project? // It is relative to `vetur.config.js`. root: "./packages/repo1", // **optional** default: `"package.json"` // Where is `package.json` in the project? // We use it to determine the version of vue. // It is relative to root property. package: "./package.json", // **optional** // Where is TypeScript config file in the project? // It is relative to root property. tsconfig: "./tsconfig.json", // **optional** default: `"./.vscode/vetur/snippets"` // Where is vetur custom snippets folders? snippetFolder: "./.vscode/vetur/snippets", // **optional** default: `[]` // Register globally Vue component glob. // If you set it, you can get completion by that components. // It is relative to root property. // Notice: It won"t actually do it. You need to use `require.context` or `Vue.component` globalComponents: [ "./src/components/**/*.vue" ] } ] }关闭提示
勾选如下选择框
最后
重启项目就没有对应的提示了,对应的js文件也可以通过Ctrl+单击进入