摘要: import { AutocompleteInput, Create, SimpleForm, TextInput } from 'react-admin'; const PostCreate = () => { const categories = [ { name: 'Tech', id: 't 阅读全文
posted @ 2023-08-22 21:04 前端导师歌谣 阅读(18) 评论(0) 推荐(0)
摘要: import { useGetList, AutocompleteInput } from 'react-admin'; const UserCountry = () => { const { data, isLoading } = useGetList('countries'); // data 阅读全文
posted @ 2023-08-22 21:04 前端导师歌谣 阅读(14) 评论(0) 推荐(0)
摘要: import { useGetList } from 'react-admin'; const LatestNews = () => { const { data, total, isLoading, error } = useGetList( 'posts', { pagination: { pa 阅读全文
posted @ 2023-08-22 21:03 前端导师歌谣 阅读(9) 评论(0) 推荐(0)
摘要: const filterToQuery = searchText => ({ name_ilike: `%${searchText}%` }); <ReferenceInput label="Author" source="author_id" reference="authors"> <Autoc 阅读全文
posted @ 2023-08-22 21:03 前端导师歌谣 阅读(8) 评论(0) 推荐(0)
摘要: <AutocompleteInput source="author_id" choices={choices} emptyValue={0} /> 设置空选项 阅读全文
posted @ 2023-08-22 21:03 前端导师歌谣 阅读(17) 评论(0) 推荐(0)
摘要: <AutocompleteInput source="author_id" choices={choices} validate={required()} /> <AutocompleteInput source="author_id" choices={choices} emptyText="No 阅读全文
posted @ 2023-08-22 21:03 前端导师歌谣 阅读(15) 评论(0) 推荐(0)
摘要: <ReferenceInput label="Author" source="author_id" reference="authors"> <AutocompleteInput debounce={500} /> </ReferenceInput> 保证不会频繁调用api 阅读全文
posted @ 2023-08-22 21:02 前端导师歌谣 阅读(7) 评论(0) 推荐(0)
摘要: import { CreateCategory } from './CreateCategory'; const PostCreate = () => ( <Create> <SimpleForm> <TextInput source="title" /> <ReferenceInput sourc 阅读全文
posted @ 2023-08-22 21:02 前端导师歌谣 阅读(15) 评论(0) 推荐(0)
摘要: const choices = [ { _id: 'tech', label: 'Tech' }, { _id: 'lifestyle', label: 'Lifestyle' }, { _id: 'people', label: 'People' }, ]; <AutocompleteInput 阅读全文
posted @ 2023-08-22 21:02 前端导师歌谣 阅读(19) 评论(0) 推荐(0)
摘要: const choices = [ { id: 'tech', name: 'Tech' }, { id: 'lifestyle', name: 'Lifestyle' }, { id: 'people', name: 'People' }, ]; <AutocompleteInput source 阅读全文
posted @ 2023-08-22 21:01 前端导师歌谣 阅读(13) 评论(0) 推荐(0)