当前位置 : 主页 > 手机开发 > harmonyos >

前端项目实战贰佰叁拾捌react-admin+material ui-react-admin-Resource中userParams获取参数

来源:互联网 收集:自由互联 发布时间:2023-08-26
import { Edit, SimpleForm, TextInput } from 'react-admin';import { useParams } from 'react-router-dom';export const SongDetail = () = { const { id, songId } = useParams(); return ( Edit resource="posts" id={songId} redirect={`/artists/${id}


import { Edit, SimpleForm, TextInput } from 'react-admin';
import { useParams } from 'react-router-dom';

export const SongDetail = () => {
    const { id, songId } = useParams();
    return (
        <Edit resource="posts" id={songId} redirect={`/artists/${id}/songs`}>
            <SimpleForm>
                <TextInput source="title" />
                <DateInput source="released" />
                <TextInput source="writer" />
                <TextInput source="producer" />
                <TextInput source="recordCompany" label="Label" />
            </SimpleForm>
        </Edit>
    );
};
网友评论