feat: 添加 AccordionItem 的 description 属性。
| | |
| | | */ |
| | | export type AccordionItemType = { |
| | | title: string, |
| | | description: string, |
| | | children?: React.ReactNode, |
| | | isActive?: boolean|false, |
| | | clickItem: () => void |
| | | } |
| | | const AccordionItem: React.FC<AccordionItemType> = ({ title, children, isActive, clickItem }) => { |
| | | const AccordionItem: React.FC<AccordionItemType> = ({ title,description, children, isActive, clickItem }) => { |
| | | return ( |
| | | <div className={`accordion-item ${isActive ? 'active' : ''}`}> |
| | | <div className="accordion-header" onClick={clickItem}> |
| | |
| | | <List.Item.Meta |
| | | avatar={<Avatar src={`https://api.dicebear.com/7.x/miniavs/svg?seed=${1}`} />} |
| | | title={title} |
| | | description={"dsadsahgjdshgfjdjh"} |
| | | description={description} |
| | | /> |
| | | </List.Item> |
| | | </List> |
| | |
| | | <div> |
| | | {pageData?.data.totalRow > 0 ? pageData?.data.records.map((item: any, index: number) => { |
| | | return ( |
| | | <AccordionItem key={index} title={item.name} isActive={selectedIndex == index} |
| | | clickItem={() => { |
| | | if (selectedIndex == index) { |
| | | setSelectedIndex(-1) |
| | | } else { |
| | | setSelectedIndex(index) |
| | | } |
| | | }}> |
| | | <AccordionItem |
| | | key={index} |
| | | title={item.name} |
| | | description={item.description} |
| | | isActive={selectedIndex == index} |
| | | clickItem={() => { |
| | | if (selectedIndex == index) { |
| | | setSelectedIndex(-1) |
| | | } else { |
| | | setSelectedIndex(index) |
| | | } |
| | | }} |
| | | > |
| | | <List |
| | | dataSource={item.tools} |
| | | renderItem={(item: any, index) => ( |