Jingzhen
2025-06-22
请问大家,本站post页面(例如https://www.codefather.cn/post/1936081812592168962)的粘性侧边栏是怎么实现的?是不是需要改BasicLayout的css?不知道开发大佬是否方便透露。 AI告诉我需要这样修改BasicLayout的index.css和index.tsx: ```css #basicLayout .ant-pro-layout-content { overflow: visible !important; } ``` ``` <ProLayout layout="top" location={{ pathname, }} fixedHeader={true} > <div> <Row gutter={[12, 0]} style={{ alignItems: "flex-start" }}> <Col xs={24} sm={24} md={16}> {children} </Col> <Col xs={0} sm={0} md={8}> <Sidebar /> </Col> </Row> </div> </ProLayout> ``` Sidebar如下,使用了StickyBox: ``` 'use client'; import React from 'react'; import StickyBox from 'react-sticky-box'; const Sidebar: React.FC = () => { return ( <StickyBox> <div> .... </div> </StickyBox> ); }; export default Sidebar; ``` 但是无效……
0个评论
点击登录,快来和大家讨论吧~
表情
图片
暂无评论
下载 APP