Skip to content

Commit

Permalink
Merge cde08ce into 5390f40
Browse files Browse the repository at this point in the history
  • Loading branch information
wangdaodao authored Nov 3, 2021
2 parents 5390f40 + cde08ce commit ea1ec7b
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 8 deletions.
2 changes: 1 addition & 1 deletion packages/progress/src/progress.vue
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<div class="el-progress-bar" v-if="type === 'line'">
<div class="el-progress-bar__outer" :style="{height: strokeWidth + 'px'}">
<div class="el-progress-bar__inner" :style="barStyle">
<div class="el-progress-bar__innerText" v-if="showText && textInside">{{content}}</div>
<div class="el-progress-bar__innerText" :style="{fontSize: progressTextSize + 'px'}" v-if="showText && textInside">{{content}}</div>
</div>
</div>
</div>
Expand Down
14 changes: 9 additions & 5 deletions packages/theme-chalk/src/progress.scss
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,17 @@
position: relative;
line-height: 1;

@include m(line) {
display: table;
width: 100%;
}

@include e(text) {
font-size:14px;
color: $--color-text-regular;
display: inline-block;
display: table-cell;
vertical-align: middle;
margin-left: 10px;
padding-left: 10px;
line-height: 1;

i {
Expand All @@ -30,6 +35,7 @@
width: 100%;
text-align: center;
margin: 0;
padding: 0;
transform: translate(0, -50%);

i {
Expand Down Expand Up @@ -91,11 +97,9 @@
}

@include b(progress-bar) {
padding-right: 50px;
display: inline-block;
display: table-cell;
vertical-align: middle;
width: 100%;
margin-right: -55px;
box-sizing: border-box;

@include e(outer) {
Expand Down
5 changes: 3 additions & 2 deletions test/unit/specs/progress.spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -98,10 +98,11 @@ describe('Progress', () => {
it('should work with stroke-width', () => {
vm = createVue({
template: `
<el-progress :text-inside="true" :stroke-width="36" :percentage="0"></el-progress>
<el-progress :text-inside="true" :stroke-width="50" :percentage="0"></el-progress>
`
}, true);
expect(vm.$el.querySelector('.el-progress-bar__innerText').offsetTop).to.be.equal(12);
expect(vm.$el.querySelector('.el-progress-bar__innerText').offsetTop).to.be.equal(9);
expect(vm.$el.querySelector('.el-progress-bar__innerText').style.fontSize).to.be.equal('32px');
});
it('color', () => {
vm = createVue({
Expand Down

0 comments on commit ea1ec7b

Please sign in to comment.