File tree Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Expand file tree Collapse file tree 2 files changed +13
-2
lines changed Original file line number Diff line number Diff line change @@ -67,11 +67,20 @@ export const renderLabel = (data, prop) => {
6767 }
6868
6969 const cls = [ 'org-tree-node-label-inner' ] ;
70+
71+ let { labelWidth, labelClassName } = prop ;
72+
73+ if ( typeof labelWidth === 'number' ) {
74+ labelWidth += 'px' ;
75+ }
76+
77+ labelClassName && cls . push ( labelClassName ) ;
7078
7179 return React . createElement ( 'div' , {
7280 className : 'org-tree-node-label' ,
7381 } , [ React . createElement ( 'div' , {
7482 className : cls . join ( ' ' ) ,
83+ style : { width : labelWidth } ,
7584 } , childNodes ) ] ) ;
7685} ;
7786
Original file line number Diff line number Diff line change @@ -85,8 +85,10 @@ OrgTree.propTypes = {
8585 horizontal : PropTypes . bool ,
8686 collapsable : PropTypes . bool ,
8787 expandAll : PropTypes . bool ,
88- renderContent : PropTypes . func
89- } ;
88+ renderContent : PropTypes . func ,
89+ labelWidth : PropTypes . number ,
90+ labelClassName : PropTypes . string
91+ }
9092
9193OrgTree . defaultProps = {
9294 node : {
You can’t perform that action at this time.
0 commit comments