I have a menu made with MATERIAL UI 4, it is posed of a first TreeItem with my main menu and a second TreeItem with my submenu.
I would like to add a specific icon to each label of the main menu.
How can I do ?
Is it possible that when I click on two drop-down menus, the first is reset by default ( no dropdown ).
{stoMenu && (
<TreeView
style={test.menu}
>
{Menu.root.children.map(test=> {
return (
<TreeItem
key={test.nodeId}
nodeId={test.nodeId}
label={test.text}
>
{test.children.map(child => {
return (
<TreeItem
key={child.nodeId}
nodeId={child.nodeId}
label={child.text}
>
<Redirect to={child.id} />
</TreeItem>
);
})}
</TreeItem>
);
})}
</TreeView>
)}
I have a menu made with MATERIAL UI 4, it is posed of a first TreeItem with my main menu and a second TreeItem with my submenu.
I would like to add a specific icon to each label of the main menu.
How can I do ?
Is it possible that when I click on two drop-down menus, the first is reset by default ( no dropdown ).
{stoMenu && (
<TreeView
style={test.menu}
>
{Menu.root.children.map(test=> {
return (
<TreeItem
key={test.nodeId}
nodeId={test.nodeId}
label={test.text}
>
{test.children.map(child => {
return (
<TreeItem
key={child.nodeId}
nodeId={child.nodeId}
label={child.text}
>
<Redirect to={child.id} />
</TreeItem>
);
})}
</TreeItem>
);
})}
</TreeView>
)}
Share
edited Sep 23, 2019 at 15:22
Paul Hub
asked Sep 19, 2019 at 8:00
Paul HubPaul Hub
1813 silver badges9 bronze badges
1
- 1 Please mark answer as accepted if that helped you :) – Eugene Chybisov Commented Sep 20, 2019 at 8:34
1 Answer
Reset to default 6They have great example how to do that https://codesandbox.io/s/material-demo-ui4dx
Also be careful with TreeView ponent as it is still in Lab and can be with some issues and not finished implementation.