Warm tip: This article is reproduced from serverfault.com, please click

component has been registered but not used vue/no-unused-components

发布于 2020-01-20 10:32:00

Created my component EmployeeTable.vue Then I exported as

<script>
export default {
  name: "employee-table"
};
</script>

But when I import it in App.vue as follows import EmployeeTable from "@/components/EmployeeTable.vue"; I get this error

error  The "EmployeeTable" component has been registered but not used  vue/no-unused-components
Questioner
joash
Viewed
0
Oleh Korniichuk 2020-01-20 18:40:39

It's your es-lint setup. You can change it to not that strict rules or you can fix this actual problem. 1. Make sure that in App.vue you registered it in a components section like this:

...
components: {
    EmployeeTable
},
...

2. Make sure you used it in App.vue template:

<EmployeeTable />