Skip to content

Commit 0f90bda

Browse files
committed
fix:lib
1 parent 7061538 commit 0f90bda

File tree

2 files changed

+20
-16
lines changed

2 files changed

+20
-16
lines changed

lib/index.js

+7-6
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
/*!
2-
* light-vue-tree v1.0.1
2+
* light-vue-tree v1.0.3
33
* open source under the MIT license
44
*/
55

@@ -435,22 +435,23 @@
435435
expanded = _node$data.expanded,
436436
isLeaf = _node$data.isLeaf,
437437
children = node.children;
438-
return children && children.length || lazy && !isLeaf ? expandIconSlot ? h("div", {
438+
return h("div", {
439+
"class": "expand_box",
439440
"style": {
440441
display: visibleExpand
441442
}
442-
}, [expandIconSlot({
443+
}, [children && children.length || lazy && !isLeaf ? expandIconSlot ? expandIconSlot({
443444
expanded: expanded,
444445
node: node,
445446
toggleFold: toggleFold
446-
})]) : h("span", {
447+
}) : h("span", {
447448
"class": ['icon', expanded ? 'rotate180-enter icon-expand' : 'rotate180-leave icon-unexpand'],
448449
"on": {
449450
"click": function click() {
450451
return toggleFold(node);
451452
}
452453
}
453-
}, ["\u25BC"]) : null;
454+
}, ["\u25BC"]) : null]);
454455
},
455456
renderCheckbox: function renderCheckbox() {
456457
var h = this.$createElement;
@@ -2396,7 +2397,7 @@
23962397
dropType = 'none';
23972398
}
23982399

2399-
var iconPosition = dropNode.$el.querySelector('.icon').getBoundingClientRect();
2400+
var iconPosition = dropNode.$el.querySelector('.expand_box').getBoundingClientRect();
24002401
var dropIndicator = this.$refs.dropIndicator;
24012402

24022403
if (dropType === 'before') {

lib/style/index.css

+13-10
Original file line numberDiff line numberDiff line change
@@ -93,16 +93,18 @@
9393
align-items: center;
9494
padding-left: 22px;
9595
}
96-
.vue-tree .child-node .node-content .icon {
96+
.vue-tree .child-node .node-content .expand_box {
97+
height: 100%;
98+
overflow: hidden;
9799
position: absolute;
98100
display: inline-block;
99101
left: 0px;
100102
font-size: 12px;
101103
}
102-
.vue-tree .child-node .node-content .icon-expand {
103-
color: #1F2E4D;
104+
.vue-tree .child-node .node-content .expand_box .icon-expand {
105+
color: #1f2e4d;
104106
}
105-
.vue-tree .child-node .node-content .icon-unexpand {
107+
.vue-tree .child-node .node-content .expand_box .icon-unexpand {
106108
color: #b7beca;
107109
}
108110
.vue-tree .child-node .node-content .inner-wrap {
@@ -119,7 +121,7 @@
119121
border-bottom: 1px solid #409eff;
120122
}
121123
.vue-tree .child-node .active-li .inner-wrap {
122-
background: #F1F3F5;
124+
background: #f1f3f5;
123125
}
124126
.vue-tree .child-node .inset {
125127
cursor: move;
@@ -134,12 +136,12 @@
134136
background-color: #409eff;
135137
color: #fff;
136138
}
137-
.vue-checkbox {
139+
.vue-tree .vue-checkbox {
138140
position: relative;
139141
width: 13px;
140142
height: 13px;
141143
}
142-
.vue-checkbox-input {
144+
.vue-tree .vue-checkbox-input {
143145
position: absolute;
144146
width: 100%;
145147
height: 100%;
@@ -148,8 +150,9 @@
148150
z-index: 3;
149151
margin: 0;
150152
background: transparent;
153+
cursor: pointer;
151154
}
152-
.vue-checkbox-indeterminate {
155+
.vue-tree .vue-checkbox-indeterminate {
153156
box-sizing: border-box;
154157
position: absolute;
155158
width: 100%;
@@ -160,9 +163,9 @@
160163
z-index: 4;
161164
border-radius: 3px;
162165
}
163-
.vue-checkbox-indeterminate:after {
166+
.vue-tree .vue-checkbox-indeterminate:after {
164167
position: absolute;
165-
content: '';
168+
content: "";
166169
width: 100%;
167170
height: 2px;
168171
background: #fff;

0 commit comments

Comments
 (0)