'Vue component registration

I have imported the component in the js file

import fmsSubUnitDetails from '../subunitDetails';

export default{
 components: {
    fmsSubUnitDetails
  },
}

in the index.vue file

<fmsSubUnitDetails></fmsSubUnitDetails>

but still getting error

[Vue warn]: Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the "name" option.

I have tried changing path like adding or removing '/' in the import, it renders the component but as soon as I hard refresh, the component stops rendering again.



Solution 1:[1]

Is it a recursive component? If so, I think you need to use the same name you defined on the component (or the kebab version of it)

export default { 
    name: 'SubUnitDetails', 
    data() { 
        return { properties };
    }
}
import SubUnitDetails from '../subunitDetails';

export default {
    components: { SubUnitDetails },
}

<SubUnitDetails></SubUnitDetails >

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 T. Antunes