fix: input-number单位报错&增强button样式 (#5593)

Co-authored-by: hongyang03 <hongyang03@baidu.com>
This commit is contained in:
HongYang 2022-10-19 16:56:33 +08:00 committed by GitHub
parent 8fc6d45b4d
commit ebafc99f36
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 61 additions and 1 deletions

View File

@ -316,6 +316,66 @@ $ns: 'antd-';
--button-secondary-disabled-left-border-color: #e8e9eb;
--button-secondary-disabled-left-border-style: solid;
--button-secondary-disabled-left-border-width: 1px;
--button-enhance-default-shadow: 0px 0px 0px 0px transparent;
--button-enhance-default-font-color: #1890ff;
--button-enhance-default-bg-color: #ffffff;
--button-enhance-default-top-border-color: #1890ff;
--button-enhance-default-top-border-style: solid;
--button-enhance-default-top-border-width: 1px;
--button-enhance-default-right-border-color: #1890ff;
--button-enhance-default-right-border-style: solid;
--button-enhance-default-right-border-width: 1px;
--button-enhance-default-bottom-border-color: #1890ff;
--button-enhance-default-bottom-border-style: solid;
--button-enhance-default-bottom-border-width: 1px;
--button-enhance-default-left-border-color: #1890ff;
--button-enhance-default-left-border-style: solid;
--button-enhance-default-left-border-width: 1px;
--button-enhance-hover-shadow: 0px 0px 0px 0px transparent;
--button-enhance-hover-font-color: #45abff;
--button-enhance-hover-bg-color: #ffffff;
--button-enhance-hover-top-border-color: #45abff;
--button-enhance-hover-top-border-style: solid;
--button-enhance-hover-top-border-width: 1px;
--button-enhance-hover-right-border-color: #45abff;
--button-enhance-hover-right-border-style: solid;
--button-enhance-hover-right-border-width: 1px;
--button-enhance-hover-bottom-border-color: #45abff;
--button-enhance-hover-bottom-border-style: solid;
--button-enhance-hover-bottom-border-width: 1px;
--button-enhance-hover-left-border-color: #45abff;
--button-enhance-hover-left-border-style: solid;
--button-enhance-hover-left-border-width: 1px;
--button-enhance-active-shadow: 0px 0px 0px 0px transparent;
--button-enhance-active-font-color: #096dd9;
--button-enhance-active-bg-color: #ffffff;
--button-enhance-active-top-border-color: #096dd9;
--button-enhance-active-top-border-style: solid;
--button-enhance-active-top-border-width: 1px;
--button-enhance-active-right-border-color: #096dd9;
--button-enhance-active-right-border-style: solid;
--button-enhance-active-right-border-width: 1px;
--button-enhance-active-bottom-border-color: #096dd9;
--button-enhance-active-bottom-border-style: solid;
--button-enhance-active-bottom-border-width: 1px;
--button-enhance-active-left-border-color: #096dd9;
--button-enhance-active-left-border-style: solid;
--button-enhance-active-left-border-width: 1px;
--button-enhance-disabled-shadow: 0px 0px 0px 0px transparent;
--button-enhance-disabled-font-color: #b8bcbf;
--button-enhance-disabled-bg-color: #f7f9fa;
--button-enhance-disabled-top-border-color: #e8e9eb;
--button-enhance-disabled-top-border-style: solid;
--button-enhance-disabled-top-border-width: 1px;
--button-enhance-disabled-right-border-color: #e8e9eb;
--button-enhance-disabled-right-border-style: solid;
--button-enhance-disabled-right-border-width: 1px;
--button-enhance-disabled-bottom-border-color: #e8e9eb;
--button-enhance-disabled-bottom-border-style: solid;
--button-enhance-disabled-bottom-border-width: 1px;
--button-enhance-disabled-left-border-color: #e8e9eb;
--button-enhance-disabled-left-border-style: solid;
--button-enhance-disabled-left-border-width: 1px;
--button-info-default-shadow: 0px 0px 0px 0px transparent;
--button-info-default-font-color: #ffffff;
--button-info-default-bg-color: #1890ff;

View File

@ -283,7 +283,7 @@ export default class NumberControl extends React.Component<
const prevUnitValue = this.state.unit;
this.setState({unit: option.value}, () => {
if (value) {
value = value.replace(prevUnitValue, '');
value = value.toString().replace(prevUnitValue, '');
this.props.onChange(value + this.state.unit);
}
});