Child Component not getting registered on a global component?
See original GitHub issuei dont know if i am missing something… but the following code is not working
let nav = Vue.extend({
template: require('../templates/nav/nav.html'),
components: {
'item': {
name:'item',
template: require('../templates/nav/item.html')
}
}
});
Vue.component('nav', nav);
<nav>
<item></item>
</nav>
it says…
app.js:1112 [Vue warn]: Unknown custom element: <item> - did you register the component correctly? For recursive components, make sure to provide the "name" option.
Vue v1.0.25
Issue Analytics
- State:
- Created 7 years ago
- Comments:9 (5 by maintainers)
Top Results From Across the Web
Child components not updating global state - Stack Overflow
1 Answer 1 · On the NumOfTitles.js file you are setting the field "materialType" instead of the "numOfTitles" field. · On the SubjOfInterest.js ......
Read more >Component Registration - Vue.js
Global registration makes dependency relationships less explicit in large applications. It makes it difficult to locate a child component's implementation from ...
Read more >Component interaction - Angular
The parent-child relationship of the components is not established within each component's respective class with the local variable technique. Because the class ...
Read more >Registering child components with parent : r/reactjs - Reddit
If I wait until after the component is mounted to register that, I might get a flicker as the data in the parent...
Read more >Parent/Child Component Communication in Vue
Although it is not a very convincing reason, the convention to stick to events for communication between child components and their parent ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
@Milewski you can try to use
inline-template
, but this won’t let you specify templates for the components, and will prohibit the use of slots.so it means externally if i am outside of the template i cant invoke the child… it would need to be a global component for that and access the parent with this.$parent ?
for example this workflow would be impossible right?
in this example the
<child>
must to be a global component… and the two child will be exactly the same not mattering who is the parent? if i want to differentiate them then i would go like thisso in this case i will have 4 global components… this is the only way? there is no way to shirnk it down to 2 global components
<parent>
and<another-parent>
and have the<child>
element as a child within the same name?and
note: i am using the same name
<child>
on both places