From e6941ae487100eaef15c16555429ad1a3b026eda Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?kiner-tang=28=E6=96=87=E8=BE=89=29?= <1127031143@qq.com> Date: Sat, 16 Sep 2023 08:23:21 +0800 Subject: [PATCH] refactor: Select.Options => options --- src/pages/list/search/projects/index.tsx | 47 ++++++++++++++---------- 1 file changed, 27 insertions(+), 20 deletions(-) diff --git a/src/pages/list/search/projects/index.tsx b/src/pages/list/search/projects/index.tsx index 2edec8ca..70400a33 100644 --- a/src/pages/list/search/projects/index.tsx +++ b/src/pages/list/search/projects/index.tsx @@ -9,10 +9,15 @@ import TagSelect from './components/TagSelect'; import type { ListItemDataType } from './data.d'; import { queryFakeList } from './service'; import useStyles from './style.style'; +import { DefaultOptionType } from 'antd/es/select'; dayjs.extend(relativeTime); -const { Option } = Select; +const categoryOptions: DefaultOptionType[] = Array.from({length: 12}).map((_, index) => ({ + value: `cat${index + 1}`, + label: `类目${index + 1}`, +})); + const FormItem = Form.Item; const { Paragraph } = Typography; const getKey = (id: string, index: number) => `${id}-${index}`; @@ -103,18 +108,9 @@ const Projects: FC = () => { > - 类目一 - 类目二 - 类目三 - 类目四 - 类目五 - 类目六 - 类目七 - 类目八 - 类目九 - 类目十 - 类目十一 - 类目十二 + {categoryOptions.map((category) => ( + {category.label} + ))} @@ -128,9 +124,13 @@ const Projects: FC = () => { maxWidth: 200, width: '100%', }} - > - - + options={[ + { + label: '王昭君', + value: 'lisa', + } + ]} + /> @@ -141,10 +141,17 @@ const Projects: FC = () => { maxWidth: 200, width: '100%', }} - > - - - + options={[ + { + label: '优秀', + value: 'good', + }, + { + label: '普通', + value: 'normal', + } + ]} + />