feat(Progress): add stroke-width prop (#4397)

This commit is contained in:
neverland
2019-09-08 16:49:17 +08:00
committed by GitHub
parent 88433a9c61
commit 7dbfbb9bcd
6 changed files with 45 additions and 20 deletions
+10 -2
View File
@@ -1,4 +1,4 @@
import { createNamespace, isDef } from '../utils';
import { createNamespace, isDef, addUnit } from '../utils';
import { BLUE, WHITE } from '../utils/constant';
const [createComponent, bem] = createNamespace('progress');
@@ -8,6 +8,7 @@ export default createComponent({
inactive: Boolean,
pivotText: String,
pivotColor: String,
strokeWidth: [String, Number],
percentage: {
type: Number,
required: true,
@@ -69,8 +70,15 @@ export default createComponent({
width: (this.progressWidth * percentage) / 100 + 'px'
};
let wrapperStyle;
if (this.strokeWidth) {
wrapperStyle = {
height: addUnit(this.strokeWidth)
};
}
return (
<div class={bem()}>
<div class={bem()} style={wrapperStyle}>
<span class={bem('portion')} style={portionStyle}>
{showPivot && (
<span ref="pivot" style={pivotStyle} class={bem('pivot')}>