Skip to content

Commit 234633e

Browse files
committed
fix: update lib
1 parent 19fb1ea commit 234633e

File tree

1 file changed

+20
-20
lines changed

1 file changed

+20
-20
lines changed

lib/index.js

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -383,8 +383,6 @@
383383
selectToggle: function selectToggle(val, node) {
384384
var _this2 = this;
385385

386-
console.log('val:::', val);
387-
388386
if (!this.tree.checkStrictly) {
389387
var exceptDisabledChecked = node.isExceptDisabledChecked();
390388
Object.assign(node.data, {
@@ -418,24 +416,26 @@
418416
vNode: this
419417
});
420418
}
421-
422-
console.log('this.tree.checkedNodes:::', this.tree.checkedNodes);
423419
},
424420
clickContent: function clickContent() {
425-
console.log('clickContent');
426421
this.tree.handleClickNode(this);
427422
},
428423
handleClickCheckBox: function handleClickCheckBox(e) {
429424
e.stopPropagation();
430425
},
431-
renderExpandSlot: function renderExpandSlot() {
426+
renderExpand: function renderExpand() {
432427
var h = this.$createElement;
433-
var expandIconSlot = this.tree.$scopedSlots.expandIcon;
428+
var _this$tree2 = this.tree,
429+
expandIconSlot = _this$tree2.$scopedSlots.expandIcon,
430+
lazy = _this$tree2.lazy;
434431
var node = this.node,
435432
toggleFold = this.toggleFold,
436433
visibleExpand = this.visibleExpand;
437-
var expanded = node.data.expanded;
438-
return expandIconSlot ? h("div", {
434+
var _node$data = node.data,
435+
expanded = _node$data.expanded,
436+
isLeaf = _node$data.isLeaf,
437+
children = node.children;
438+
return children && children.length || lazy && !isLeaf ? expandIconSlot ? h("div", {
439439
"style": {
440440
display: visibleExpand
441441
}
@@ -450,21 +450,21 @@
450450
return toggleFold(node);
451451
}
452452
}
453-
}, ["\u25BC"]);
453+
}, ["\u25BC"]) : null;
454454
},
455455
renderCheckbox: function renderCheckbox() {
456456
var h = this.$createElement;
457457
var node = this.node,
458458
handleClickCheckBox = this.handleClickCheckBox,
459459
selectToggle = this.selectToggle;
460-
var _this$tree2 = this.tree,
461-
checkboxSlot = _this$tree2.$scopedSlots.checkbox,
462-
showCheckbox = _this$tree2.showCheckbox;
463-
var _node$data = node.data,
464-
checked = _node$data.checked,
465-
partialSelected = _node$data.partialSelected,
466-
exceptDisabledChecked = _node$data.exceptDisabledChecked,
467-
disabled = _node$data.disabled;
460+
var _this$tree3 = this.tree,
461+
checkboxSlot = _this$tree3.$scopedSlots.checkbox,
462+
showCheckbox = _this$tree3.showCheckbox;
463+
var _node$data2 = node.data,
464+
checked = _node$data2.checked,
465+
partialSelected = _node$data2.partialSelected,
466+
exceptDisabledChecked = _node$data2.exceptDisabledChecked,
467+
disabled = _node$data2.disabled;
468468
return showCheckbox ? checkboxSlot ? checkboxSlot({
469469
handleClickCheckBox: handleClickCheckBox,
470470
selectToggle: selectToggle,
@@ -512,15 +512,15 @@
512512
var h = arguments[0];
513513
var clickContent = this.clickContent,
514514
activeNode = this.activeNode,
515-
renderExpandSlot = this.renderExpandSlot,
515+
renderExpand = this.renderExpand,
516516
renderCheckbox = this.renderCheckbox,
517517
renderLoading = this.renderLoading,
518518
renderNodeName = this.renderNodeName;
519519
return h("div", {
520520
"class": ['node-content', {
521521
'active-li': activeNode
522522
}]
523-
}, [renderExpandSlot(), h("div", {
523+
}, [renderExpand(), h("div", {
524524
"class": ['inner-wrap'],
525525
"on": {
526526
"click": clickContent

0 commit comments

Comments
 (0)