<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} /> ) }
最终保证嵌入之后没有缝隙