Skip to content

Commit b65d221

Browse files
wewoormumiao
authored andcommitted
feat(editor): custom the TabPane renderer
1 parent fd4f009 commit b65d221

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

src/workbench/editor/group.tsx

+8-2
Original file line numberDiff line numberDiff line change
@@ -87,8 +87,14 @@ function EditorGroup(props: IEditorGroupProps & IEditorController) {
8787
<EditorBreadcrumb breadcrumbs={tab.breadcrumb} />
8888
<div className={groupContainerClassName}>
8989
{
90-
// Default we use monaco editor, but also you can customize by renderPanel() function
91-
tab.renderPanel || (
90+
// Default we use monaco editor, but also you can customize by renderPanel() function or a react element
91+
tab.renderPanel ? (
92+
typeof tab.renderPanel === 'function' ? (
93+
tab.renderPanel(tab.data)
94+
) : (
95+
tab.renderPanel
96+
)
97+
) : (
9298
<MonacoEditor
9399
options={{
94100
value: tab.data?.value,

0 commit comments

Comments
 (0)