reason:
eslint
the code checks that you registered the component but did not use it, and then reports an error. For example, code:
For example, the file
component is registered in Vue
, but it is not actually used:
...
import File from "../../components/file";
export default {
components: {Pagination, File},
...
At this time, you can cancel the registration. Of course, sometimes we don’t want to cancel and don’t change the code. There are two solutions:
Method 1:
Modify the package. JSON
in package.JSON
, find rules
under eslintconfig
, and add "Vue/no unused components": "off"
Method 2:
If there is a eslintrc.JS
file in the project, you can add it as well:
rules: {
"vue/no-unused-components": "off"
}
Either of the two can be used. Restart the project after modification. Note: if both files are modified, the eslintrc.JS
file has higher priority.
Read More:
- [Solved] Vue3.0 Error: The component has been registered but not used vue/no-unused-components, Close eslint
- [Solved] Vue eslint Error: Component name “*****“ should always be multi-word
- Vue Project Error: Expected indentation of 2 spaces but found 4,Newline required at end of file but not found
- Vue warn]: vue3 element Component emit Pass Event Error
- [Solved] Vue Error: error ‘xxx‘ is defined but never used no-unused-vars
- [Solved] vue error: error Component name “School“ should always be multi-word vue/multi-word-component-names
- 9:13 error Component name “home“ should always be multi-word vue/multi-word-component-names
- [Solved] component import error is declared in the statement of components
- [Solved] Vue Error: error: ‘to‘ is defined but never used (no-unused-vars)
- vue error: ‘ev’ is defined but never used (no-unused-vars)
- [Solved] Vue3 Error: Failed to resolve component:xxx
- [Solved] error Component name “xxx“ should always be multi-word vue/multi-word-comp
- [Solved] Vue Less error: Webpack project report expected indentation of 0 spaces but found 2
- [Solved] VUE eslint Error: Expected linebreaks to be ‘LF‘ but found ‘CRLF
- Vue element component V-for error [How to Modify)
- ERROR Error: [@ant-design/icons-angular]:the icon XXX does not exist or is not registered.
- [Solved] Vue3.2 component computed Error: Write operation failed: computed value is readonly
- vue3 import Error: has no default export [How to Solve]
- [Solved] MSBUILD : error MSB3428: Could not load the Visual C++ component “VCBuild.exe“
- [Solved] 1:1 error Component name “Header“ should always be multi-word vue/multi-word