问题
Is it possible to have a Sidebar + Fixed Top Menu in Semantic-UI React?
回答1:
have you tried something like this ?
<!-- Top fixed menu -->
<Menu fixed="top">
<Button className="item" onClick={this.toggleVisible}>
<i className="sidebar icon" />
</Button>
<Menu.Item name="home" as={Link} to="/your_route">
<Icon name="home" />Menu item
</Menu.Item>
</Menu>
<!-- Sidebar & pusher -->
<Sidebar.Pushable as={Segment}>
<!-- Sidebar menu -->
<Sidebar
visible={this.state.visible}
as={Menu}
animation="push"
width="thin"
icon="labeled"
vertical
inverted
>
<Menu.Item name="home" as={Link} to="/your_route">
<Icon name="home" />Sidebar menu item
</Menu.Item>
</Sidebar>
<!-- pusher container -->
<Sidebar.Pusher>
<Segment basic>Whatever content</Segment>
</Sidebar.Pusher>
</Sidebar.Pushable>
You must implement toggleVisible function to toggle sidebar visible state.
来源:https://stackoverflow.com/questions/50153383/sidebar-fixed-top-menu-in-semantic-ui-react