2 回答

TA貢獻(xiàn)1876條經(jīng)驗(yàn) 獲得超7個(gè)贊
使用普通的內(nèi)聯(lián)樣式就可以了
<Accordion>
<Card>
<Accordion.Toggle as={Card.Header} eventKey="0" style={{color: 'red'}}>
...
您還可以用它構(gòu)建自定義組件,參考相關(guān)文檔:custom-toggle
例子:
export default function App() {
return (
<div className="App">
<Accordion defaultActiveKey="0">
<Card>
<Accordion.Toggle as={Card.Header} eventKey="0" style={{color: 'red'}}>
Click me!
</Accordion.Toggle>
<Accordion.Collapse eventKey="0">
<Card.Body>Text</Card.Body>
</Accordion.Collapse>
</Card>
<Card border="secondary">
<Accordion.Toggle as={Card.Header} eventKey="1">
Click me!
</Accordion.Toggle>
<Accordion.Collapse eventKey="1">
<Card.Body>Hello! I'm another body</Card.Body>
</Accordion.Collapse>
</Card>
</Accordion>
</div>
);
}
- 2 回答
- 0 關(guān)注
- 186 瀏覽
添加回答
舉報(bào)