|
383 | 383 | selectToggle: function selectToggle(val, node) {
|
384 | 384 | var _this2 = this;
|
385 | 385 |
|
386 |
| - console.log('val:::', val); |
387 |
| - |
388 | 386 | if (!this.tree.checkStrictly) {
|
389 | 387 | var exceptDisabledChecked = node.isExceptDisabledChecked();
|
390 | 388 | Object.assign(node.data, {
|
|
418 | 416 | vNode: this
|
419 | 417 | });
|
420 | 418 | }
|
421 |
| - |
422 |
| - console.log('this.tree.checkedNodes:::', this.tree.checkedNodes); |
423 | 419 | },
|
424 | 420 | clickContent: function clickContent() {
|
425 |
| - console.log('clickContent'); |
426 | 421 | this.tree.handleClickNode(this);
|
427 | 422 | },
|
428 | 423 | handleClickCheckBox: function handleClickCheckBox(e) {
|
429 | 424 | e.stopPropagation();
|
430 | 425 | },
|
431 |
| - renderExpandSlot: function renderExpandSlot() { |
| 426 | + renderExpand: function renderExpand() { |
432 | 427 | 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; |
434 | 431 | var node = this.node,
|
435 | 432 | toggleFold = this.toggleFold,
|
436 | 433 | 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", { |
439 | 439 | "style": {
|
440 | 440 | display: visibleExpand
|
441 | 441 | }
|
|
450 | 450 | return toggleFold(node);
|
451 | 451 | }
|
452 | 452 | }
|
453 |
| - }, ["\u25BC"]); |
| 453 | + }, ["\u25BC"]) : null; |
454 | 454 | },
|
455 | 455 | renderCheckbox: function renderCheckbox() {
|
456 | 456 | var h = this.$createElement;
|
457 | 457 | var node = this.node,
|
458 | 458 | handleClickCheckBox = this.handleClickCheckBox,
|
459 | 459 | 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; |
468 | 468 | return showCheckbox ? checkboxSlot ? checkboxSlot({
|
469 | 469 | handleClickCheckBox: handleClickCheckBox,
|
470 | 470 | selectToggle: selectToggle,
|
|
512 | 512 | var h = arguments[0];
|
513 | 513 | var clickContent = this.clickContent,
|
514 | 514 | activeNode = this.activeNode,
|
515 |
| - renderExpandSlot = this.renderExpandSlot, |
| 515 | + renderExpand = this.renderExpand, |
516 | 516 | renderCheckbox = this.renderCheckbox,
|
517 | 517 | renderLoading = this.renderLoading,
|
518 | 518 | renderNodeName = this.renderNodeName;
|
519 | 519 | return h("div", {
|
520 | 520 | "class": ['node-content', {
|
521 | 521 | 'active-li': activeNode
|
522 | 522 | }]
|
523 |
| - }, [renderExpandSlot(), h("div", { |
| 523 | + }, [renderExpand(), h("div", { |
524 | 524 | "class": ['inner-wrap'],
|
525 | 525 | "on": {
|
526 | 526 | "click": clickContent
|
|
0 commit comments