Semantic-User React中的侧边栏+固定顶部菜单

问题描述 投票:2回答:1

是否可以在Semantic-UI React中使用补充工具栏+固定顶部菜单?

reactjs semantic-ui semantic-ui-react
1个回答
3
投票

你试过这样的事吗?

<!-- 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>

您必须实现toggleVisible函数才能切换侧边栏可见状态。

© www.soinside.com 2019 - 2024. All rights reserved.