fix: 修复进度条样式问题 (#3857)

Co-authored-by: liujintao03 <liujintao03@baidu.com>
This commit is contained in:
gooolh 2022-03-25 18:08:11 +08:00 committed by GitHub
parent 6dc472d2e7
commit 0aff997f8f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 8 additions and 11 deletions

View File

@ -6,7 +6,6 @@
&-line {
display: inline-block;
width: 100%;
height: 10px;
&-inter {
height: 100%;
@ -30,10 +29,7 @@
&-bar {
float: left;
width: 0;
height: 100%;
font-size: 12px;
line-height: 10px;
text-align: center;
height: 10px;
background: var(--primary);
transition: width var(--animation-duration) ease;
@ -75,8 +71,7 @@
}
&-circle {
width: 120px;
height: 120px;
width: 100%;
position: relative;
&-text {
position: absolute;

View File

@ -110,16 +110,15 @@ export class Progress extends React.Component<ProgressProps, Object> {
if (typeof value !== 'number') {
viewValue = <span className="text-muted">{placeholder}</span>;
} else if (type === 'line') {
const style: any = {};
const barStyle: any = {
width: `${value}%`
};
strokeWidth && (style.height = strokeWidth);
strokeWidth && (barStyle.height = strokeWidth);
!isColorClass && (barStyle.backgroundColor = bgColor);
viewValue = [
<div key="progress" className={cx(prefixCls, progressClassName)}>
<div className={cx(`${prefixCls}-inter`)} style={style}>
<div className={cx(`${prefixCls}-inter`)}>
<div
className={cx(
`${prefixCls}-bar`,
@ -149,7 +148,10 @@ export class Progress extends React.Component<ProgressProps, Object> {
};
viewValue = [
<div className={cx(prefixCls, progressClassName)} key="circle">
<div
className={cx(prefixCls, progressClassName || 'w-ssm')}
key="circle"
>
<Circle
percent={value}
strokeColor={!isColorClass ? bgColor : ''}