import { List, BooleanField, TextField, Datagrid, WithListContext } from 'react-admin'; import IconEvent from '@mui/icons-material/Event'; import { Typography,Stack } from '@mui/material'; const Aside = () => ( <div style={{ width: 200, margin: '1em' }}> <Typography variant="h6">歌谣</Typography> <Typography variant="body2"> 歌谣不要方 </Typography> </div> ); export const RChildrenList = () => { return (<List resource="t_geyao_person"> {/* <Datagrid> <TextField source='id'></TextField> <TextField source='name'></TextField> <TextField source='sex'></TextField> <TextField source='salary'></TextField> <BooleanField source='status'></BooleanField> </Datagrid> */} <WithListContext render={({ data }) => ( <Stack spacing={2} sx={{ padding: 2 }}> {data?.map(book => ( <Typography key={book.id}> <i>{book.id}</i>, by {book.name} ({book.sex}) </Typography> ))} </Stack> )} /> </List>) }
运行结果