mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-13 08:12:48 +02:00
parent
93e2b7dab3
commit
f15ba1b2ac
1 changed files with 27 additions and 18 deletions
|
@ -28,26 +28,35 @@ class MarkdownBlock extends React.Component {
|
|||
return (
|
||||
<div className="tabs">
|
||||
<div className="nav-tabs">
|
||||
{tabs.map((t, i) => (
|
||||
<div
|
||||
className={`nav-link${i === 0 ? ' active' : ''}`}
|
||||
id={`${t.id}-tab`}
|
||||
data-group={`group_${t.groupId}`}
|
||||
data-tab={`tabpanel_${t.id}`}>
|
||||
{t.label}
|
||||
</div>
|
||||
))}
|
||||
{tabs.map((t, i) => {
|
||||
const tabId = `tab-group-${groupId}-tab-${t.id}`;
|
||||
const contentId = `tab-group-${groupId}-content-${t.id}`;
|
||||
return (
|
||||
<div
|
||||
id={tabId}
|
||||
key={tabId}
|
||||
className={`nav-link${i === 0 ? ' active' : ''}`}
|
||||
data-group={`group_${t.groupId}`}
|
||||
data-tab={contentId}>
|
||||
{t.label}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
<div className="tab-content">
|
||||
{tabs.map((t, i) => (
|
||||
<div
|
||||
className={`tab-pane${i === 0 ? ' active' : ''}`}
|
||||
data-group={`group_${t.groupId}`}
|
||||
tabIndex="-1"
|
||||
id={`tabpanel_${t.id}`}>
|
||||
{t.panelContent}
|
||||
</div>
|
||||
))}
|
||||
{tabs.map((t, i) => {
|
||||
const id = `tab-group-${groupId}-content-${t.id}`;
|
||||
return (
|
||||
<div
|
||||
id={id}
|
||||
key={id}
|
||||
className={`tab-pane${i === 0 ? ' active' : ''}`}
|
||||
data-group={`group_${t.groupId}`}
|
||||
tabIndex="-1">
|
||||
{t.panelContent}
|
||||
</div>
|
||||
);
|
||||
})}
|
||||
</div>
|
||||
</div>
|
||||
);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue