美文网首页
antd使用Layout组件,Content内容过多,造成页面塌

antd使用Layout组件,Content内容过多,造成页面塌

作者: Poppy11 | 来源:发表于2021-01-21 09:25 被阅读0次

设置Layout的最小高度为可视区域的高度

  <Layout style={{ minHeight: document.documentElement.clientHeight }}>
      <Header className="header">
        <img className="logo" src={logo} />
      </Header>
      <Content style={{ marginTop: 64}}>
        <div className="site-layout-background" style={{ padding: 24, minHeight: 380 }}>
          <BrowserRouter>
            <Switch>
              <Route path={url + 'manage'} component={Manage} />
              <Route path='/view' component={View} />
              <Route path={url + 'submit'} component={Submit} />
            </Switch>
          </BrowserRouter>
        </div>
      </Content>
      <Footer style={{ textAlign: 'center' }}>Newegg ©2021</Footer>
    </Layout>

相关文章

网友评论

      本文标题:antd使用Layout组件,Content内容过多,造成页面塌

      本文链接:https://www.haomeiwen.com/subject/xmkdaktx.html