- #1
mathmari
Gold Member
MHB
- 5,049
- 7
Hey! ![Smile :smile: :smile:](data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///yH5BAEAAAAALAAAAAABAAEAAAIBRAA7)
I want to create a side menu.
I have written the following in a file menu.js :
The code without the SubOption1 works properly.
When I run it with the Suboption 1 I get in the browser all Options and above the options I get in red letters "Menu Items Error" and the suboption is not shown. What am I doing wrong?![Thinking face :thinking: 🤔](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f914.png)
I want to create a side menu.
I have written the following in a file menu.js :
JavaScript:
const menu_items = {
id: 'menu',
title: 'Menu',
type: 'group',
children: [
{
id: 'Option1',
title: 'Option 1',
type: 'group',
children: [
{
id: 'SubOption1',
title: 'Suboption 1',
type: 'item',
url: '/Option-1/SubOption-1'
}
]
},
{
id: 'Option2',
title: 'Option 2',
type: 'item',
url: '/Option-2'
},
{
id: 'Option3',
title: 'Option 3',
type: 'item',
url: '/Option-3'
},
{
id: 'Option4',
title: 'Option 4',
type: 'item',
url: '/Option-4'
},
{
id: 'Option5',
title: 'Option 5',
type: 'item',
url: '/Option-5'
},
{
id: 'Profile',
title: 'Profile',
type: 'item',
url: '/Profile'
}
]
};
export default menu_items;
The code without the SubOption1 works properly.
When I run it with the Suboption 1 I get in the browser all Options and above the options I get in red letters "Menu Items Error" and the suboption is not shown. What am I doing wrong?
![Thinking face :thinking: 🤔](https://cdn.jsdelivr.net/joypixels/assets/8.0/png/unicode/64/1f914.png)
Last edited: