前端项目实战壹佰壹拾柒react-admin+material ui-react-admin之SimpleList中primaryText使用一返回函数

我是歌谣 这里是歌谣的前端笔记小屋 想加入前端巅峰人才交流群私信我 

 

import { List, SimpleList } from 'react-admin';

export const RSimpleStandard = () => (
    <List resource="t_geyao_person">
        <SimpleList 
            primaryText={record => record.name}
            secondaryText={record => `${record.name} views`}
            tertiaryText={record => record.name}
            linkType={record => record.status ? "edit" : "show"}
            rowStyle={record => ({ backgroundColor: record.nb_views
 >= 500 ? '#efe' : 'white' })}
        />
    </List>
);

运行结果

 

posted @ 2023-07-31 19:34  前端导师歌谣  阅读(11)  评论(0)    收藏  举报  来源