perf: 滚动条

main
Lei OT 3 days ago
parent 5694081269
commit 40ca0bdf8d

@ -10,8 +10,8 @@ const HeaderWrapper = ({ children, header, loading, backTo, ...props }) => {
} = theme.useToken(); } = theme.useToken();
return ( return (
<> <>
<Spin spinning={loading || false}> <Spin spinning={loading || false} wrapperClassName='h-full [&_.ant-spin-container]:h-full' >
<Layout className=' bg-white'> <Layout className=' bg-white h-full'>
<Header className='header px-6 h-10 ' style={{ background: 'white' }}> <Header className='header px-6 h-10 ' style={{ background: 'white' }}>
<Flex justify={'space-between'} align={'center'} className='h-full'> <Flex justify={'space-between'} align={'center'} className='h-full'>
{/* {header} */} {/* {header} */}
@ -20,7 +20,7 @@ const HeaderWrapper = ({ children, header, loading, backTo, ...props }) => {
</Flex> </Flex>
</Header> </Header>
<Divider className='my-2' /> <Divider className='my-2' />
<Content className='' style={{ backgroundColor: colorBgContainer }}> <Content className='overflow-auto' style={{ backgroundColor: colorBgContainer }}>
{children || <Outlet />} {children || <Outlet />}
</Content> </Content>
</Layout> </Layout>

@ -98,7 +98,7 @@ function App() {
</FloatButton.Group> </FloatButton.Group>
{contextHolder} {contextHolder}
<ErrorBoundary> <ErrorBoundary>
<Layout className='min-h-screen'> <Layout className='min-h-screen h-dvh'>
<Header className='sticky top-0 z-10 w-full'> <Header className='sticky top-0 z-10 w-full'>
<Row gutter={{ md: 24 }} justify='end' align='middle'> <Row gutter={{ md: 24 }} justify='end' align='middle'>
<Col span={15}> <Col span={15}>
@ -159,7 +159,7 @@ function App() {
</Col> </Col>
</Row> </Row>
</Header> </Header>
<Content className='p-6 m-0 min-h-72 bg-white'> <Content className='p-6 m-0 min-h-72 bg-white overflow-auto'>
{needToLogin ? <>login...</> : <Outlet />} {needToLogin ? <>login...</> : <Outlet />}
</Content> </Content>
<Footer>China Highlights International Travel Service Co., LTD, Version: {BUILD_VERSION}</Footer> <Footer>China Highlights International Travel Service Co., LTD, Version: {BUILD_VERSION}</Footer>

@ -43,11 +43,11 @@ function Detail() {
backTo={false} backTo={false}
header={<Header title={activeAgency.travel_agency_name} refresh={handleGetAgencyProducts} handleNewProduct={() => setAddProductVisible(true)} />}> header={<Header title={activeAgency.travel_agency_name} refresh={handleGetAgencyProducts} handleNewProduct={() => setAddProductVisible(true)} />}>
<> <>
<Flex gap={10}> <Flex gap={10} className='h-full'>
{/* onNodeSelect={handleNodeSelect} */} {/* onNodeSelect={handleNodeSelect} */}
<ProductsTree className='basis-80 sticky top-16 overflow-y-auto shrink-0' style={{ height: 'calc(100vh - 150px)' }} /> <ProductsTree className='basis-80 sticky top-0 overflow-y-auto shrink-0' style1={{ height: 'calc(100vh - 150px)' }} />
<Divider type={'vertical'} className='mx-1 h-auto' /> <Divider type={'vertical'} className='mx-1 h-auto' />
<div className=' flex-auto '> <div className=' flex-auto overflow-auto '>
<ProductInfo /> <ProductInfo />
</div> </div>
</Flex> </Flex>

Loading…
Cancel
Save