Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Яков
react-finder
Commits
84ef543e
Commit
84ef543e
authored
Aug 17, 2021
by
Яков
Browse files
add func renderHeaderColumn
parent
7bd49cc7
Changes
2
Show whitespace changes
Inline
Side-by-side
package.json
View file @
84ef543e
...
...
@@ -86,5 +86,15 @@
},
"resolutions"
:
{
"graceful-fs"
:
"^4.2.4"
},
"babel"
:
{
"presets"
:
[
"@babel/preset-react"
,
"@babel/preset-env"
],
"plugins"
:
[
"@babel/plugin-transform-react-jsx"
,
"@babel/plugin-proposal-class-properties"
]
}
}
src/ReactFinder.js
View file @
84ef543e
...
...
@@ -122,18 +122,22 @@ class ReactFinder extends PureComponent {
}
renderDetail
()
{
const
{
renderDetail
,
dataSource
,
nodeKey
,
childrenPropName
}
=
this
.
props
;
const
{
selectedKey
}
=
this
.
state
;
const
{
renderDetail
,
dataSource
,
nodeKey
,
childrenPropName
}
=
this
.
props
;
const
{
selectedKey
}
=
this
.
state
;
const
el
=
renderDetail
&&
renderDetail
({
selectedKey
,
selectedData
:
findInTree
(
dataSource
,
n
=>
n
[
nodeKey
]
===
selectedKey
,
{
childrenName
:
childrenPropName
}
n
=>
n
[
nodeKey
]
===
selectedKey
,
{
childrenName
:
childrenPropName
}
)
});
if
(
el
)
{
return
(
<
div
className
=
"
react-finder-detail
"
>
{
el
}
<
/div>
)
;
return
(
<
div
className
=
"
react-finder-detail
"
>
{
el
}
<
/div
>
);
}
return
null
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment