Skip to content

Commit

Permalink
【update】指标排列方式样式优化; review by songym
Browse files Browse the repository at this point in the history
  • Loading branch information
xiongjiaojiao committed Apr 28, 2020
1 parent cb56822 commit 8ed2e3f
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 36 deletions.
44 changes: 22 additions & 22 deletions src/common/indicator/Indicator.vue
Original file line number Diff line number Diff line change
@@ -1,29 +1,29 @@
<template>
<div class="sm-component-indicator" :style="[getBackgroundStyle, { 'flex-direction': direction }]">
<div class="sm-component-indicator__head">
<div class="sm-component-indicator" :style="getBackgroundStyle">
<div :class="`sm-component-indicator__content sm-component-indicator__content-${mode}`">
<span v-show="showTitleUnit" class="sm-component-indicator__title" :style="[unit_titleStyle, getTextColorStyle]">
{{ titleData }}
</span>
</div>
<div class="sm-component-indicator__content">
<span class="sm-component-indicator__num" :style="[indicatorStyle]">
<countTo
v-if="isNumber(indicatorNum)"
:decimals="calDecimals"
:startVal="startData"
:endVal="numData"
:duration="Number(duration) || 1000"
:separator="separator"
:numBackground="numBackground"
:numSpacing="numSpacing"
:separatorBackground="separatorBackground"
:fontSize="fontSize"
></countTo>
{{ isNumber(indicatorNum) ? '' : indicatorNum }}
</span>
<span v-show="showTitleUnit" class="sm-component-indicator__unit" :style="[unit_titleStyle, getTextColorStyle]">{{
unitData
}}</span>
<div>
<span class="sm-component-indicator__num" :style="[indicatorStyle]">
<countTo
v-if="isNumber(indicatorNum)"
:decimals="calDecimals"
:startVal="startData"
:endVal="numData"
:duration="Number(duration) || 1000"
:separator="separator"
:numBackground="numBackground"
:numSpacing="numSpacing"
:separatorBackground="separatorBackground"
:fontSize="fontSize"
></countTo>
{{ isNumber(indicatorNum) ? '' : indicatorNum }}
</span>
<span v-show="showTitleUnit" class="sm-component-indicator__unit" :style="[unit_titleStyle, getTextColorStyle]">
{{ unitData }}
</span>
</div>
</div>
</div>
</template>
Expand Down
33 changes: 19 additions & 14 deletions src/common/indicator/style/indicator.scss
Original file line number Diff line number Diff line change
Expand Up @@ -4,28 +4,33 @@
@include b(indicator) {
display: inline-flex;
flex-wrap: nowrap;
flex-direction: column;
justify-content: center;
align-items: center;
color: #595959;
padding-left: 10px;
@include e(head) {
@include e(content) {
display: flex;
align-items: flex-end;
font-weight: bolder;
}
@include e(content-vertical) {
flex-direction: column;
align-items: flex-start;
.sm-component-indicator__title {
margin-bottom: 8px;
padding-left: 5px;
}
}
@include e(content-horizontal) {
flex-flow: row nowrap;
justify-content: flex-start;
padding-left: 5px;
margin-right: 5px;
width: 100%;
justify-content: space-around;
.sm-component-indicator__title {
line-height: 1.2;
}
}
@include e(title) {
font-size: 16px;
line-height: 2.3;
font-weight: bolder;
}
@include e(content) {
display: flex;
flex-flow: row nowrap;
align-items: flex-end;
font-weight: bolder;
margin-right: 10px;
}
@include e(num) {
font-weight: bolder;
Expand Down

0 comments on commit 8ed2e3f

Please sign in to comment.