Skip to content

Commit e936e60

Browse files
committed
小箭头替换成css绘制
1 parent 2ecef53 commit e936e60

File tree

1 file changed

+10
-5
lines changed

1 file changed

+10
-5
lines changed

src/search-node.vue

Lines changed: 10 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -27,12 +27,10 @@ export default {
2727
let hideMisses = root.filterNode(deepCopy(data)) && (!root.hideMisses || data.visible)
2828
return hideMisses ? <ul class="tree-ul">
2929
<li class="tree-li">
30-
<svg t="1585220115926" class="tree-icon point" viewBox="0 0 1024 1024" version="1.1" xmlns="http://www.w3.org/2000/svg" p-id="2222" width="10" height="10" style={{
30+
<i class="tree-triangle point" style={{
3131
transform: `rotate(${data.expand ? '0' : '-90'}deg)`,
3232
visibility: data[children].length ? 'visible' : 'hidden'
33-
}} onClick={e => this.handlerExpand(e)}>
34-
<path d="M151.476947 199.553918l718.53082 0c39.763632 0 71.922053 31.909757 71.922053 71.675436 0 18.485003-7.095605 35.205826-18.486026 47.872311L568.114019 793.227056c-23.810289 31.400151-68.641333 37.993313-100.29731 14.183024-5.570879-4.052293-10.384511-8.873088-14.183024-14.190187L94.235245 314.041416c-23.547299-31.407314-17.217127-76.479859 14.436804-100.041484 12.922311-9.881045 27.864628-14.43885 42.804898-14.43885l0 0L151.476947 199.553918zM151.476947 199.553918" p-id="2223" fill="#c0c4cc"></path>
35-
</svg>
33+
}} onClick={e => this.handlerExpand(e)}></i>
3634
{
3735
root.showCheckbox && <zCheckbox
3836
theme-color={root.themeColor}
@@ -51,7 +49,7 @@ export default {
5149
root.$scopedSlots.default ? root.$scopedSlots.default(data) : <p class="tree-text">
5250
{
5351
data.$keys.length ? data[name].split('').map((curr, i) => {
54-
return <span class={ data.$keys.includes(i) ? 'red': 'gary' }>{curr}</span>
52+
return <span class={ data.$keys.includes(i) ? 'red' : 'gary' }>{curr}</span>
5553
}) : <span class="gary">{data[name]}</span>
5654
}
5755
</p>
@@ -128,6 +126,13 @@ export default {
128126
text-overflow: ellipsis;
129127
white-space: nowrap;
130128
}
129+
.tree-triangle {
130+
width: 0px;
131+
height: 0px;
132+
border-top: #c0c4cc 6px solid;
133+
border-right: transparent 4px solid;
134+
border-left: transparent 4px solid;
135+
}
131136
.tree-content {
132137
width: 100%;
133138
margin: 0 0 0 3px;

0 commit comments

Comments
 (0)