Skip to content

Commit

Permalink
feat(editor): custom the TabPane renderer
Browse files Browse the repository at this point in the history
  • Loading branch information
wewoor authored and mumiao committed Apr 24, 2021
1 parent fd4f009 commit b65d221
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions src/workbench/editor/group.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -87,8 +87,14 @@ function EditorGroup(props: IEditorGroupProps & IEditorController) {
<EditorBreadcrumb breadcrumbs={tab.breadcrumb} />
<div className={groupContainerClassName}>
{
// Default we use monaco editor, but also you can customize by renderPanel() function
tab.renderPanel || (
// Default we use monaco editor, but also you can customize by renderPanel() function or a react element
tab.renderPanel ? (
typeof tab.renderPanel === 'function' ? (
tab.renderPanel(tab.data)
) : (
tab.renderPanel
)
) : (
<MonacoEditor
options={{
value: tab.data?.value,
Expand Down

0 comments on commit b65d221

Please sign in to comment.