fix: treeNode cannot get origin column

pull/2130/head
tanjinzhou 2020-04-21 16:11:43 +08:00
parent 7f1072aa3d
commit f9b233f39d
1 changed files with 9 additions and 5 deletions

View File

@ -345,7 +345,7 @@ const TreeNode = {
class={classNames(`${prefixCls}-switcher`, `${prefixCls}-switcher-noop`)} class={classNames(`${prefixCls}-switcher`, `${prefixCls}-switcher-noop`)}
> >
{typeof switcherIcon === 'function' {typeof switcherIcon === 'function'
? switcherIcon({ ...this.$props, isLeaf: true }) ? switcherIcon({ ...this.$props, ...this.$props.dataRef, isLeaf: true })
: switcherIcon} : switcherIcon}
</span> </span>
); );
@ -358,7 +358,7 @@ const TreeNode = {
return ( return (
<span key="switcher" onClick={this.onExpand} class={switcherCls}> <span key="switcher" onClick={this.onExpand} class={switcherCls}>
{typeof switcherIcon === 'function' {typeof switcherIcon === 'function'
? switcherIcon({ ...this.$props, isLeaf: false }) ? switcherIcon({ ...this.$props, ...this.$props.dataRef, isLeaf: false })
: switcherIcon} : switcherIcon}
</span> </span>
); );
@ -430,7 +430,9 @@ const TreeNode = {
const currentIcon = icon || treeIcon; const currentIcon = icon || treeIcon;
$icon = currentIcon ? ( $icon = currentIcon ? (
<span class={classNames(`${prefixCls}-iconEle`, `${prefixCls}-icon__customize`)}> <span class={classNames(`${prefixCls}-iconEle`, `${prefixCls}-icon__customize`)}>
{typeof currentIcon === 'function' ? currentIcon({ ...this.$props }, h) : currentIcon} {typeof currentIcon === 'function'
? currentIcon({ ...this.$props, ...this.$props.dataRef }, h)
: currentIcon}
</span> </span>
) : ( ) : (
this.renderIcon() this.renderIcon()
@ -442,12 +444,14 @@ const TreeNode = {
const currentTitle = title; const currentTitle = title;
let $title = currentTitle ? ( let $title = currentTitle ? (
<span class={`${prefixCls}-title`}> <span class={`${prefixCls}-title`}>
{typeof currentTitle === 'function' ? currentTitle({ ...this.$props }, h) : currentTitle} {typeof currentTitle === 'function'
? currentTitle({ ...this.$props, ...this.$props.dataRef }, h)
: currentTitle}
</span> </span>
) : ( ) : (
<span class={`${prefixCls}-title`}>{defaultTitle}</span> <span class={`${prefixCls}-title`}>{defaultTitle}</span>
); );
return ( return (
<span <span
key="selector" key="selector"