Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Button:修复图标按钮不居中 #985

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/button/Button.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export default class Button extends Component {
})} disabled={this.props.disabled} type={this.props.nativeType} onClick={this.onClick.bind(this)}>
{ this.props.loading && <i className="el-icon-loading" /> }
{ this.props.icon && !this.props.loading && <i className={`el-icon-${this.props.icon}`} /> }
<span>{this.props.children}</span>
{ this.props.children && <span>{this.props.children}</span> }
</button>
)
}
Expand Down
27 changes: 16 additions & 11 deletions src/progress/Progress.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,15 +52,19 @@ export default class Progress extends Component {

stroke(): string {
let ret;
switch (this.props.status) {
case 'success':
ret = '#13ce66';
break;
case 'exception':
ret = '#ff4949';
break;
default:
ret = '#20a0ff';
if(this.props.color){
ret = this.props.color
}else{
switch (this.props.status) {
case 'success':
ret = '#13ce66';
break;
case 'exception':
ret = '#ff4949';
break;
default:
ret = '#20a0ff';
}
}
return ret;
}
Expand Down Expand Up @@ -97,7 +101,7 @@ export default class Progress extends Component {
>
<div
className="el-progress-bar__inner"
style={{ width: `${percentage}%` }}
style={{ width: `${percentage}%`, backgroundColor: this.props.color }}
>
{showText &&
textInside &&
Expand Down Expand Up @@ -167,5 +171,6 @@ Progress.propTypes = {
strokeWidth: PropTypes.number,
width: PropTypes.number,
textInside: PropTypes.bool,
showText: PropTypes.bool
showText: PropTypes.bool,
color: PropTypes.string,
};