Sidebar + Fixed Top Menu in Semantic-UI React

我是研究僧i 提交于 2020-05-29 11:09:14

问题


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

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!