Answer the question
In order to leave comments, you need to log in
How to fix error when importing parent component into child Vue.js?
Good time!
The essence of the problem is this:
What can cause the error Unknown custom element: - did you register the component correctly? For recursive components, make sure to provide the "name" option. when importing a parent comment <temp-component>
into a child one with the following hierarchy:
<temp-component>
<rowComponent>
<colComponent>
и тут импортируется <temp-component></temp-component>
</colComponent>
</rowComponent>
</temp-component>
<temp-component>
in the child element, everything works.
Answer the question
In order to leave comments, you need to log in
Components must have the name property specified, in components of a child component, the name of the parent component must be the same as name.
Perhaps the used component was specified incorrectly, or was not specified at all.
import TempComponent from './temp-component.vue'
export default {
name: 'root-component-name',
components: {
TempComponent
}
etc...
}
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question