1
I couldn’t understand how far I can divide my components in Vue.js
It is common for an application to be organized into a component tree nested:
For example, you may have components for a header, bar side and content area, each containing normally other components for navigation links, blog posts, etc.
It’s right then I do it this way?
- Menu
- Submenu
- Topics of the submenu
- Submenu
Let’s imagine this following picture:
So:
Menu would be the Grandfather, submerge the father and the children topics?
I’m not sure how this part of Components works properly.
If I had then one more submenu in Biology he would enter here being like grandson (of course father)?
Edit 1: I’ll give you in code version, this may help clarify the question further:
JS
Vue.component('navbar',{
template: '#navbar'
})
Vue.component('submenu',{
template: '#submenu'
})
Vue.component('lista-submenu',{
template: '#lista-submenu'
})
Okay, here it will be clearer, I have 3 components navbar
, submenu
and lista-submenu
The navbar
would be the Learn of the photo
The submenu
Home, Knowledge Map, Math, Science, etc
To lista-submenu
Biology, Chemistry, Physics...
Now what happens if I have another submenu?
Example
Enterprise -> navbar
Contact Us, Contact Us, What We Are -> submenu
(Emptiness) -> lista-submenu
Doubt:
- It’s gonna be, like, another component, like,
lista-submenu-2
- As far as I can keep breaking into components
Parent menu is the main menu example: Home Company Blog Contact << are parent menus The submenus that belong to them are the children. .
– Lucas Antonio
And the topics would be grandchildren?
– user152996
No menu topics, only submenus '-'
– Lucas Antonio
Look at your print, it’s a burger menu and a menu with submenus.
– Lucas Antonio
I’ll edit the question, better.
– user152996