Skip to content

Commit 8ed2e3f

Browse files
committed
【update】指标排列方式样式优化; review by songym
1 parent cb56822 commit 8ed2e3f

File tree

2 files changed

+41
-36
lines changed

2 files changed

+41
-36
lines changed

src/common/indicator/Indicator.vue

Lines changed: 22 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,29 @@
11
<template>
2-
<div class="sm-component-indicator" :style="[getBackgroundStyle, { 'flex-direction': direction }]">
3-
<div class="sm-component-indicator__head">
2+
<div class="sm-component-indicator" :style="getBackgroundStyle">
3+
<div :class="`sm-component-indicator__content sm-component-indicator__content-${mode}`">
44
<span v-show="showTitleUnit" class="sm-component-indicator__title" :style="[unit_titleStyle, getTextColorStyle]">
55
{{ titleData }}
66
</span>
7-
</div>
8-
<div class="sm-component-indicator__content">
9-
<span class="sm-component-indicator__num" :style="[indicatorStyle]">
10-
<countTo
11-
v-if="isNumber(indicatorNum)"
12-
:decimals="calDecimals"
13-
:startVal="startData"
14-
:endVal="numData"
15-
:duration="Number(duration) || 1000"
16-
:separator="separator"
17-
:numBackground="numBackground"
18-
:numSpacing="numSpacing"
19-
:separatorBackground="separatorBackground"
20-
:fontSize="fontSize"
21-
></countTo>
22-
{{ isNumber(indicatorNum) ? '' : indicatorNum }}
23-
</span>
24-
<span v-show="showTitleUnit" class="sm-component-indicator__unit" :style="[unit_titleStyle, getTextColorStyle]">{{
25-
unitData
26-
}}</span>
7+
<div>
8+
<span class="sm-component-indicator__num" :style="[indicatorStyle]">
9+
<countTo
10+
v-if="isNumber(indicatorNum)"
11+
:decimals="calDecimals"
12+
:startVal="startData"
13+
:endVal="numData"
14+
:duration="Number(duration) || 1000"
15+
:separator="separator"
16+
:numBackground="numBackground"
17+
:numSpacing="numSpacing"
18+
:separatorBackground="separatorBackground"
19+
:fontSize="fontSize"
20+
></countTo>
21+
{{ isNumber(indicatorNum) ? '' : indicatorNum }}
22+
</span>
23+
<span v-show="showTitleUnit" class="sm-component-indicator__unit" :style="[unit_titleStyle, getTextColorStyle]">
24+
{{ unitData }}
25+
</span>
26+
</div>
2727
</div>
2828
</div>
2929
</template>

src/common/indicator/style/indicator.scss

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -4,28 +4,33 @@
44
@include b(indicator) {
55
display: inline-flex;
66
flex-wrap: nowrap;
7-
flex-direction: column;
87
justify-content: center;
8+
align-items: center;
99
color: #595959;
10-
padding-left: 10px;
11-
@include e(head) {
10+
@include e(content) {
1211
display: flex;
12+
align-items: flex-end;
13+
font-weight: bolder;
14+
}
15+
@include e(content-vertical) {
16+
flex-direction: column;
17+
align-items: flex-start;
18+
.sm-component-indicator__title {
19+
margin-bottom: 8px;
20+
padding-left: 5px;
21+
}
22+
}
23+
@include e(content-horizontal) {
1324
flex-flow: row nowrap;
14-
justify-content: flex-start;
15-
padding-left: 5px;
16-
margin-right: 5px;
25+
width: 100%;
26+
justify-content: space-around;
27+
.sm-component-indicator__title {
28+
line-height: 1.2;
29+
}
1730
}
1831
@include e(title) {
1932
font-size: 16px;
20-
line-height: 2.3;
21-
font-weight: bolder;
22-
}
23-
@include e(content) {
24-
display: flex;
25-
flex-flow: row nowrap;
26-
align-items: flex-end;
2733
font-weight: bolder;
28-
margin-right: 10px;
2934
}
3035
@include e(num) {
3136
font-weight: bolder;

0 commit comments

Comments
 (0)