简体   繁体   English

如何使 ant 布局设计适合页面

[英]How to make ant Layout design fit page

I am having a problem with using React and antd, I am using a component from the Layout page on antd.我在使用 React 和 antd 时遇到问题,我正在使用 antd 上布局页面中的组件。 There is a comma that I believe is restricting the UI from filling out the page, although it might be somethign else to do with the design.我认为有一个逗号会限制 UI 填写页面,尽管它可能与设计有关。 What I am looking to fix is too have the UI fill the page instead of the height being restricted and having a comma below it.我要解决的问题也是让 UI 填充页面,而不是限制高度并在其下方使用逗号。

UI screenshot界面截图

React Layout being rendered in App.js:在 App.js 中呈现的 React Layout:

<Layout>
            <Sider
                breakpoint="lg"
                collapsedWidth="0"
                onBreakpoint={broken => {
                    console.log(broken);
                }}
                onCollapse={(collapsed, type) => {
                    console.log(collapsed, type);
                }}
            >
                <div className="logo"/>
                <Menu theme="dark" mode="inline" defaultSelectedKeys={['4']}>
                    <Menu.Item key="1" icon={<UserOutlined/>}>
                        nav 1
                    </Menu.Item>
                    <Menu.Item key="2" icon={<VideoCameraOutlined/>}>
                        nav 2
                    </Menu.Item>
                    <Menu.Item key="3" icon={<UploadOutlined/>}>
                        nav 3
                    </Menu.Item>
                    <Menu.Item key="4" icon={<UserOutlined/>}>
                        nav 4
                    </Menu.Item>
                </Menu>
            </Sider>
            <Layout>
                <Header className="site-layout-sub-header-background" style={{padding: 0}}/>
                <Content style={{margin: '24px 16px 0'}}>
                    <div className="site-layout-background" style={{padding: 24, minHeight: 360}}>
                        content
                    </div>
                </Content>
                <Footer style={{textAlign: 'center'}}>Ant Design ©2018 Created by Ant UED</Footer>
            </Layout>
        </Layout>

I am very confused as to why there is a comma there if anyone has some suggestions any advice would be appreciated.如果有人有一些建议,我很困惑为什么那里有逗号,任何建议都将不胜感激。

Try checking your css files including frameworks like bootstrap to see if they are messing with your design尝试检查您的 css 文件,包括引导程序等框架,看看它们是否与您的设计相混淆

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM