vscode error: error The “AlarmList” component has been registered but not used, eslint syntax check

Problem Description:

The component is imported, registered in components, and used in the template, but still reports an error: error The “AlarmList” component has been registered but not used, the component is registered, but not used.
insert image description here

Solution:

Under the root path of the vue project, create a vue.config.js file (note that this file should be in the same directory as package.json), and write the following code in the file, module.exports = { lintOnSave:
false , // Turn off the eslint syntax verification rule runtimeCompiler: true, // Use the Vue kernel version that includes the runtime compiler } Then save it and restart the project.



After the solution, if the routing rules are still red, but no more errors

insert image description here

Solution:

Check whether there is this component in your own components, and you can disable it
insert image description here

Guess you like

Origin blog.csdn.net/weixin_55966654/article/details/120290394