Skip to content

Commit a5fc47c

Browse files
committed
fix: update lib
1 parent 97706a2 commit a5fc47c

File tree

2 files changed

+12
-10
lines changed

2 files changed

+12
-10
lines changed

lib/index.js

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -430,23 +430,25 @@
430430
},
431431
renderExpandSlot: function renderExpandSlot() {
432432
var h = this.$createElement;
433-
var expandIconSlot = this.tree.expandIcon;
433+
var expandIconSlot = this.tree.$scopedSlots.expandIcon;
434434
var node = this.node,
435435
toggleFold = this.toggleFold,
436436
visibleExpand = this.visibleExpand;
437437
var expanded = node.data.expanded;
438-
return expandIconSlot ? expandIconSlot({
438+
return expandIconSlot ? h("div", {
439+
"style": {
440+
display: visibleExpand
441+
}
442+
}, [expandIconSlot({
439443
expanded: expanded,
440-
toggleFoldCb: toggleFold
441-
}) : h("span", {
444+
node: node,
445+
toggleFold: toggleFold
446+
})]) : h("span", {
442447
"class": ['icon', expanded ? 'rotate180-enter icon-expand' : 'rotate180-leave icon-unexpand'],
443448
"on": {
444449
"click": function click() {
445450
return toggleFold(node);
446451
}
447-
},
448-
"style": {
449-
display: visibleExpand
450452
}
451453
}, ["\u25BC"]);
452454
},
@@ -456,7 +458,7 @@
456458
handleClickCheckBox = this.handleClickCheckBox,
457459
selectToggle = this.selectToggle;
458460
var _this$tree2 = this.tree,
459-
checkboxSlot = _this$tree2.checkbox,
461+
checkboxSlot = _this$tree2.$scopedSlots.checkbox,
460462
showCheckbox = _this$tree2.showCheckbox;
461463
var _node$data = node.data,
462464
checked = _node$data.checked,
@@ -487,7 +489,7 @@
487489
},
488490
renderLoading: function renderLoading() {
489491
var h = this.$createElement;
490-
var loadingSlot = this.tree.loading;
492+
var loadingSlot = this.tree.$scopedSlots.loading;
491493
var loading = this.loading;
492494
return loading ? loadingSlot ? loadingSlot({
493495
loading: loading

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "light-vue-tree",
3-
"version": "0.1.1",
3+
"version": "0.1.2",
44
"scripts": {
55
"lint": "eslint --fix src --ext .js --ext .vue",
66
"dev": "rollup --config ./scripts/rollup.development.js --watch",

0 commit comments

Comments
 (0)