提交 5b3ca7bb authored 作者: lidongxu's avatar lidongxu

style(components/echarts/grouplegend): 修复样式问题

宽度改变后圆圈跑出去了的样式问题
上级 6b123254
...@@ -5,9 +5,12 @@ ...@@ -5,9 +5,12 @@
v-for="item in legendData" v-for="item in legendData"
:class="item.orient"> :class="item.orient">
<div v-for="o in item.data" <div v-for="o in item.data"
:class="[o.type, o.effective ? '' : 'dis', o.show? '' : 'none']" :class="[o.type, o.effective ? '' : 'dis', o.show ? '' : 'none']"
:style="{'--color': o.color}" :style="{ '--color': o.color }"
@click="handleClick(o)">{{ o.name }}</div> @click="handleClick(o)">
<span class="e-icon"></span>
<span>{{ o.name }}</span>
</div>
</div> </div>
</div> </div>
</template> </template>
...@@ -95,8 +98,7 @@ export default { ...@@ -95,8 +98,7 @@ export default {
font-size: 12px; font-size: 12px;
cursor: pointer; cursor: pointer;
&:before { .e-icon {
content: "";
display: block; display: block;
width: 28px; width: 28px;
height: 15px; height: 15px;
...@@ -112,19 +114,17 @@ export default { ...@@ -112,19 +114,17 @@ export default {
align-items: center; align-items: center;
font-size: 12px; font-size: 12px;
cursor: pointer; cursor: pointer;
position: relative;
&:before { .e-icon {
content: ""; position: relative;
display: block; display: block;
width: 28px; width: 28px;
height: 2px; height: 2px;
background: var(--color); background: var(--color);
border-radius: 3px; border-radius: 3px;
margin-right: 5px; margin-right: 5px;
}
&:after { &:before {
content: ""; content: "";
display: block; display: block;
width: 14px; width: 14px;
...@@ -134,8 +134,10 @@ export default { ...@@ -134,8 +134,10 @@ export default {
border: 3px solid var(--color); border: 3px solid var(--color);
border-radius: 50%; border-radius: 50%;
position: absolute; position: absolute;
top: 0.5px; left: 50%;
left: 7.45px; top: 50%;
transform: translate(-50%, -50%);
}
} }
} }
...@@ -145,18 +147,28 @@ export default { ...@@ -145,18 +147,28 @@ export default {
align-items: center; align-items: center;
font-size: 12px; font-size: 12px;
cursor: pointer; cursor: pointer;
.e-icon {
position: relative; position: relative;
padding-left: 7.75px; display: block;
width: 28px;
height: 0px;
margin-right: 5px;
&:before { &:before {
content: ""; content: "";
display: block; display: block;
width: 14px; width: 14px;
height: 14px; height: 14px;
background: white; background-color: white;
box-sizing: border-box;
border: 3px solid var(--color); border: 3px solid var(--color);
border-radius: 50%; border-radius: 50%;
margin-right: 10px; position: absolute;
left: 50%;
top: 50%;
transform: translate(-50%, -50%);
}
} }
} }
...@@ -164,26 +176,17 @@ export default { ...@@ -164,26 +176,17 @@ export default {
.dis { .dis {
color: lightgray !important; color: lightgray !important;
&:before { .e-icon {
background: lightgray !important; background: lightgray !important;
border: 3px solid lightgray !important; border-color: lightgray !important;
} &:before{
border-color: lightgray !important;
&:after {
border: 3px solid lightgray !important;
} }
} }
/* 重写圆圈 */
.circle.dis {
&:before {
background: white !important;
border: 3px solid lightgray !important;
}
} }
/* 隐藏 */ /* 隐藏 */
.none{ .none {
display: none; display: none;
} }
} }
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论