Vetur can't find `tsconfig.json` or `jsconfig.json` in c:\MyReponsitory\library-management-system-web_1.
时间: 2024-01-21 12:18:00 浏览: 144
Vetur is a VS Code extension for Vue.js development. It requires a `tsconfig.json` or `jsconfig.json` file to provide configuration information for TypeScript or JavaScript respectively.
If you don't already have a `tsconfig.json` or `jsconfig.json` file in your project directory, you can create one by running `tsc --init` or `npm init` respectively.
If you do have one of these files in your project directory, make sure that it is located in the root directory of your project (`c:\MyReponsitory\library-management-system-web_1`), and that its name is spelled correctly (`tsconfig.json` or `jsconfig.json`).
If the file is located in a different directory or has a different name, you can specify its location in your VS Code settings. Open your VS Code `settings.json` file and add the following line:
```
"vetur.validation.template": false,
"vetur.useWorkspaceDependencies": true,
"vetur.experimental.templateInterpolationService": true,
"vetur.format.defaultFormatterOptions": {
"prettier": {
"singleQuote": true,
"semi": false
}
},
"vetur.format.defaultFormatter": {
"prettier": {
"useTabs": true,
"tabWidth": 2,
"singleQuote": true,
"semi": false
}
},
"vetur.validation.interpolation": false,
"vetur.validation.script": false,
"vetur.validation.style": false,
"vetur.ignoreProjectWarning": true,
"vetur.format.options.tabSize": 2,
"vetur.format.options.useTabs": false,
"vetur.format.scriptInitialIndent": false,
"vetur.format.styleInitialIndent": false,
"vetur.format.defaultFormatter.js": "prettier",
"vetur.format.defaultFormatter.html": "prettier",
"vetur.format.defaultFormatter.css": "prettier",
"vetur.format.defaultFormatter.scss": "prettier",
"vetur.format.defaultFormatter.less": "prettier",
"vetur.format.defaultFormatter.postcss": "prettier",
"vetur.validation.templateProps": false,
"vetur.validation.interpolation": false,
"vetur.format.defaultFormatterOptions": {
"prettier": {
"singleQuote": true,
"semi": false
}
},
"vetur.format.enable": true,
"vetur.validation.template": false,
"vetur.useWorkspaceDependencies": true,
"vetur.experimental.templateInterpolationService": true,
"vetur.format.defaultFormatterOptions": {
"prettier": {
"singleQuote": true,
"semi": false
}
},
"vetur.format.defaultFormatter": {
"prettier": {
"useTabs": true,
"tabWidth": 2,
"singleQuote": true,
"semi": false
}
},
"vetur.validation.interpolation": false,
"vetur.validation.script": false,
"vetur.validation.style": false,
"vetur.ignoreProjectWarning": true,
"vetur.format.options.tabSize": 2,
"vetur.format.options.useTabs": false,
"vetur.format.scriptInitialIndent": false,
"vetur.format.styleInitialIndent": false,
"vetur.format.defaultFormatter.js": "prettier",
"vetur.format.defaultFormatter.html": "prettier",
"vetur.format.defaultFormatter.css": "prettier",
"vetur.format.defaultFormatter.scss": "prettier",
"vetur.format.defaultFormatter.less": "prettier",
"vetur.format.defaultFormatter.postcss": "prettier",
"[vue]": {
"editor.defaultFormatter": "octref.vetur"
}
```
In the `"vetur.validation.template"` section, add the following line:
```
"vetur.validation.template": false,
```
This will disable template validation in Vetur, which may be causing the error message you are seeing.
I hope this helps! Let me know if you have any further questions.
阅读全文