我是歌谣 这里是歌谣的前端笔记小屋 想加入前端巅峰人才交流群私信我
import React from 'react'
import { List,TopToolbar,SortButton,SelectColumnsButton, Datagrid, TextField, EditButton, DeleteButton, BooleanField } from 'react-admin'
const PostListActions = () => (
<TopToolbar>
<SelectColumnsButton />
</TopToolbar>
);
const RSortButton = () => {
return <List actions={<PostListActions />} resource="t_geyao_person" exporter={false}>
<TopToolbar>
<SortButton fields={['reference', 'sales', 'stock']} />
</TopToolbar>
<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 RSortButton
运行结果