fix(Progress): correct pivot position (#4396)

This commit is contained in:
neverland
2019-09-08 16:37:44 +08:00
committed by GitHub
parent cea68ff252
commit 88433a9c61
4 changed files with 11 additions and 16 deletions
+3 -2
View File
@@ -60,17 +60,18 @@ export default createComponent({
const pivotStyle = {
color: this.textColor,
left: `${(this.progressWidth - this.pivotWidth) * percentage / 100}px`,
background: this.pivotColor || background
};
const portionStyle = {
background,
width: ((this.progressWidth - this.pivotWidth) * percentage) / 100 + 'px'
width: (this.progressWidth * percentage) / 100 + 'px'
};
return (
<div class={bem()}>
<span class={bem('portion', { 'with-pivot': showPivot })} style={portionStyle}>
<span class={bem('portion')} style={portionStyle}>
{showPivot && (
<span ref="pivot" style={pivotStyle} class={bem('pivot')}>
{text}