Skip to content

Commit 1c66171

Browse files
committed
fix: virtual Tree
1 parent 8e9b138 commit 1c66171

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/components/Tree/TreeNodeContent.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ export default {
7676
renderExpandSlot () {
7777
const { $scopedSlots: { expandIcon: expandIconSlot } } = this.tree
7878
const { node, toggleFold, visibleExpand } = this
79-
const { expanded } = node.data
80-
return expandIconSlot ? <div style={{ display: visibleExpand }}>{expandIconSlot({ expanded, node, toggleFold })}</div> : (<span class={['icon', expanded ? 'rotate180-enter icon-expand' : 'rotate180-leave icon-unexpand']} onClick={() => toggleFold(node)} ></span>)
79+
const { data: { expanded }, children } = node
80+
return children && children.length ? expandIconSlot ? <div style={{ display: visibleExpand }}>{expandIconSlot({ expanded, node, toggleFold })}</div> : (<span class={['icon', expanded ? 'rotate180-enter icon-expand' : 'rotate180-leave icon-unexpand']} onClick={() => toggleFold(node)} ></span>) : null
8181
},
8282
renderCheckbox () {
8383
const { node, handleClickCheckBox, selectToggle } = this

0 commit comments

Comments
 (0)