Skip to content

Commit e512f8b

Browse files
committed
statistic:Optimize the code logic and adjust the style
1 parent d9322b6 commit e512f8b

File tree

2 files changed

+32
-32
lines changed

2 files changed

+32
-32
lines changed

packages/statistic/src/main.vue

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ export default {
4747
},
4848
precision: {
4949
type: Number,
50-
default: 0
50+
default: null
5151
},
5252
value: {
5353
type: [String, Number],
@@ -139,7 +139,6 @@ export default {
139139
clearInterval(this.timeTask);
140140
this.timeTask = null;
141141
}
142-
143142
} else {
144143
this.branch();
145144
}

packages/theme-chalk/src/statistic.scss

Lines changed: 31 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -2,36 +2,37 @@
22
@import "common/var";
33

44
@include b(statistic) {
5-
width: 100%;
6-
box-sizing: border-box;
7-
margin: 0;
8-
padding: 0;
9-
color: $--color-black;
10-
font-size: 14px;
11-
font-variant: tabular-nums;
12-
line-height: 1.5715;
13-
list-style: none;
14-
font-feature-settings: "tnum";
15-
text-align: center;
16-
.head {
17-
margin-bottom: 4px;
18-
color: #00000073;
19-
font-size: 14px;
5+
$statistic-justify: center;
6+
$statistic-align: center;
7+
width: 100%;
8+
box-sizing: border-box;
9+
margin: 0;
10+
padding: 0;
11+
color: $--color-black;
12+
font-variant: tabular-nums;
13+
list-style: none;
14+
font-feature-settings: "tnum";
15+
text-align: center;
16+
.head {
17+
margin-bottom: 4px;
18+
color: $--color-text-regular;
19+
font-size: $--font-size-small;
20+
}
2021

22+
.con {
23+
font-family: Sans-serif;
24+
display: flex;
25+
justify-content: $statistic-justify;
26+
align-items: $statistic-align;
27+
color: $--color-text-primary;
28+
.number {
29+
font-size: $--font-size-extra-large;
30+
padding: 0 4px;
2131
}
22-
23-
.con{
24-
font-family: Sans-serif;
25-
display: flex;
26-
justify-content :center;
27-
align-items: center ;
28-
.number{
29-
font-size: 20px;
30-
padding: 0 4px;
31-
}
32-
span{ display: inline-block;
33-
margin: 0;
34-
line-height: 100%;
35-
}
32+
span {
33+
display: inline-block;
34+
margin: 0;
35+
line-height: 100%;
3636
}
37-
}
37+
}
38+
}

0 commit comments

Comments
 (0)