我是歌谣 这里是歌谣的前端笔记小屋 想加入前端巅峰人才交流群私信我
import React from 'react'
import { Pagination ,List,Datagrid,FilterList,FilterListItem,TextField,EditButton,DeleteButton,BooleanField,SavedQueriesList } from 'react-admin'
import { Card, CardContent } from '@mui/material'
const SongFilterSidebar = () => (
<Card>
<CardContent>
<SavedQueriesList />
<FilterList label="Record Company">
</FilterList>
<FilterList label="Released">
</FilterList>
</CardContent>
</Card>
);
const PostPagination = () => <Pagination rowsPerPageOptions={[10, 25, 50, 100]} />
const RFilterSaveQueryList = () => {
return <List pagination={<PostPagination />} resource="t_geyao_person" aside={<SongFilterSidebar />} exporter={false}>
<Datagrid>
<TextField source='id'></TextField>
<TextField source='name'></TextField>
<TextField source='sex'></TextField>
<TextField source='salary'></TextField>
<BooleanField source='status'></BooleanField>
<EditButton></EditButton>
<DeleteButton></DeleteButton>
</Datagrid>
</List>
}
export default RFilterSaveQueryList
运行结果 设置默认分页