前端项目实战叁拾陆-react-admin+material ui-侧边栏样式设定重置
我是歌谣 放弃很容易 但是坚持一定很酷 微信公众号关注前端小歌谣 带你加入前端巅峰人才交流群
<Admin
dataProvider={dataProvider}
basename= '/mydemo'
layout={appLayout}
>
<Resource name = 't_prod_style' list =
{DemoList} edit = {DemoEdit} hasEdit/>
<CustomRoutes>
<Route path = "myFirstPage/:mycode" element = {<MyFirstPage/>}/>
</CustomRoutes>
</Admin>
const appLayout = (props: LayoutProps) => {
return (
<Layout
sx={
{
'& .RaLayout-appFrame': {
minHeight: '100%',
height: '100%',
margin: 0,
padding: 0
},
'& .RaLayout-content:': { marginTop: 0, marginBottom: 0,
padding: 0, minHeight: '100%', height: '100%' },
'& .RaLayout-contentWithSidebar': { margin: 0,
padding: 0, minHeight: '100%', height: '100%' },
minHeight: '100%',
height: '100%',
margin: 0,
padding: 0,
}
}
{...props}
appBar={appBar}
menu={useAppMenu}
sidebar={mySidebar}
/>
)
}
最终保证嵌入之后没有缝隙


浙公网安备 33010602011771号