Error: Unknown custom element: <router-link>
See original GitHub issueI have an error when trying to build a sidebar navigation with sub-navs:
[Vue warn]: Unknown custom element: <router-link> - did you register the component correctly? For recursive components, make sure to provide the “name” option. (found in component <sidebar-item>)
Here is my template:
<v-sidebar id="sidebar" fixed>
<v-sidebar-items v-bind:items="sidebar_items"></v-sidebar>
</v-sidebar>
and my sidebar_items object:
sidebar_items: [
{ text: 'Dashboard', href: '#!', icon: 'dashboard' }
{
parent: { text: 'Users', href: '#!', icon: 'group' },
items: [
{ text: 'All users', href: '#!' },
{ text: 'Deleted users', href: '#!' }
]
}
]
This is the HTML:
<ul class="sidebar__items">
<li>
<router-link active-class="sidebar__item--active" to="#!" class="sidebar__item">
<i class="material-icons icon">
<span>dashboard</span>
</i>
<span>Dashboard</span>
</router-link>
</li>
<li class="sidebar__group">
<a href="#!" class="sidebar__item-header">
<i class="material-icons icon">
<span>group</span>
</i>
<span>Users</span>
</a>
<ul class="sidebar__items" style="display: none; height: 0px;">
<li>
<router-link active-class="sidebar__item--active" to="#!" class="sidebar__item">
<!---->
<span>All users</span>
</router-link>
</li>
<li>
<router-link active-class="sidebar__item--active" to="#!" class="sidebar__item">
<!---->
<span>Deleted users</span>
</router-link>
</li>
</ul>
</li>
</ul>
What am I doing wrong here??
Issue Analytics
- State:
- Created 7 years ago
- Reactions:1
- Comments:11 (5 by maintainers)
Top Results From Across the Web
[Vue warn]: Unknown custom element: <router-view> - did you ...
unfortunately starting a file gives me an error: [Vue warn]: Unknown custom element: - did you register the component correctly? For recursive ...
Read more >[Vue warn]: Unknown custom element: <router-link> · Issue ...
I don't know if this is a bug, I think it should not import vue again .
Read more >Unknown custom element: <router-link> — did you register the ...
This error was solved by adding the router: Router. But my <router-links> were not working or responding as expected. The router.js code should...
Read more >Laravel Vuejs [Vue warn]: Unknown custom element - Laracasts
But i'm experiencing this error: Copy Code app.js:38573 [Vue warn]: Unknown custom element: <router-link> - did you register the component correctly?
Read more >Error: Unknown custom element: <router-link> - Vue Forum
Hi, im new to vue and im trying to learn how to implement the vue-router plugin. I get this error: app.js:2495 [Vue warn]:...
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
I’m so stupid… I looked over that code 3 times before opening this issue and didn’t see that vue router is missing.
Thanks a lot for your help!
This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs. Please direct any non-bug questions to our Discord