Skip to content

Commit f9b233f

Browse files
committed
fix: treeNode cannot get origin column
1 parent 7f1072a commit f9b233f

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

components/vc-tree/src/TreeNode.jsx

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -345,7 +345,7 @@ const TreeNode = {
345345
class={classNames(`${prefixCls}-switcher`, `${prefixCls}-switcher-noop`)}
346346
>
347347
{typeof switcherIcon === 'function'
348-
? switcherIcon({ ...this.$props, isLeaf: true })
348+
? switcherIcon({ ...this.$props, ...this.$props.dataRef, isLeaf: true })
349349
: switcherIcon}
350350
</span>
351351
);
@@ -358,7 +358,7 @@ const TreeNode = {
358358
return (
359359
<span key="switcher" onClick={this.onExpand} class={switcherCls}>
360360
{typeof switcherIcon === 'function'
361-
? switcherIcon({ ...this.$props, isLeaf: false })
361+
? switcherIcon({ ...this.$props, ...this.$props.dataRef, isLeaf: false })
362362
: switcherIcon}
363363
</span>
364364
);
@@ -430,7 +430,9 @@ const TreeNode = {
430430
const currentIcon = icon || treeIcon;
431431
$icon = currentIcon ? (
432432
<span class={classNames(`${prefixCls}-iconEle`, `${prefixCls}-icon__customize`)}>
433-
{typeof currentIcon === 'function' ? currentIcon({ ...this.$props }, h) : currentIcon}
433+
{typeof currentIcon === 'function'
434+
? currentIcon({ ...this.$props, ...this.$props.dataRef }, h)
435+
: currentIcon}
434436
</span>
435437
) : (
436438
this.renderIcon()
@@ -442,12 +444,14 @@ const TreeNode = {
442444
const currentTitle = title;
443445
let $title = currentTitle ? (
444446
<span class={`${prefixCls}-title`}>
445-
{typeof currentTitle === 'function' ? currentTitle({ ...this.$props }, h) : currentTitle}
447+
{typeof currentTitle === 'function'
448+
? currentTitle({ ...this.$props, ...this.$props.dataRef }, h)
449+
: currentTitle}
446450
</span>
447451
) : (
448452
<span class={`${prefixCls}-title`}>{defaultTitle}</span>
449453
);
450-
454+
451455
return (
452456
<span
453457
key="selector"

0 commit comments

Comments
 (0)