mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 03:58:07 +08:00
fix: 修复进度条样式问题 (#3857)
Co-authored-by: liujintao03 <liujintao03@baidu.com>
This commit is contained in:
parent
6dc472d2e7
commit
0aff997f8f
@ -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;
|
||||
|
@ -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 : ''}
|
||||
|
Loading…
Reference in New Issue
Block a user