Just modify the root
style of TreeView
component. Add your desirable height to the height
attribute and then assing overflow
to auto to make the whole TreeView
component scrollable. Sandbox
const useStyles = makeStyles({
root: {
height: "50px",
flexGrow: 1,
maxWidth: 400,
overflow: "auto"
}
});
<TreeView
className={classes.root}
defaultCollapseIcon={<ExpandMoreIcon />}
defaultExpandIcon={<ChevronRightIcon />}
>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.