Commit 3e46efdb by 前端

更新样式

1 parent 16c4ecc2
......@@ -4,7 +4,10 @@
<div class="avatar male"></div>
<span>男</span>
<div class="progress">
<div class="fill male" :style="{ width: malePercentage==0? 50: malePercentage+ '%' }">{{
<div class="fill male" :style="{ width: malePercentage==0? 50: malePercentage+ '%','min-width':'40%',
'max-width':'50%',
'margin-left':(40 <malePercentage && malePercentage < 50 ? malePercentage/2:0 <malePercentage && malePercentage < 40?
malePercentage*2 : malePercentage/4) + '%' }">{{
malePercentage || 0
}}%
</div>
......@@ -15,7 +18,7 @@
<div class="avatar female"></div>
<span>女</span>
<div class="progress">
<div class="fill female" :style="{ width: femalePercentage== 0?50:femalePercentage + '%' }">
<div class="fill female" :style="{ width: femalePercentage== 0?50:femalePercentage + '%','min-width':'30%'}">
{{ femalePercentage || 0 }}%
</div>
</div>
......@@ -46,9 +49,9 @@ export default {
},
femalePercentage() {
if (this.maleCount + this.femaleCount == 0){
if (this.maleCount + this.femaleCount == 0) {
return 0
}else {
} else {
return (100 - this.malePercentage).toFixed(2);
}
......@@ -87,7 +90,7 @@ export default {
.progress {
justify-content: center;
width: 10vw;
width: 8vw;
height: 2.5vh;
margin: 10px 0;
......@@ -98,8 +101,8 @@ export default {
font-size: 14px;
&.male {
margin-left: 3.5vw;
padding-left: 10px;
padding-right: 15px;
padding-left: 15px;
text-align: left;
background: #5A64FF;
border-top-left-radius: 25px; // 左上角圆角
......@@ -108,7 +111,8 @@ export default {
}
&.female {
padding-right: 10px;
padding-right: 18px;
padding-left: 10px;
text-align: right;
background: #FF5A92;
border-top-right-radius: 25px;
......
Markdown is supported
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!