mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-02 11:58:10 +08:00
fix:折叠器Collapse自定义图标&inputNumber对含后缀生效 (#5591)
* fix:折叠器Collapse自定义图标&inputNumber对含后缀生效 * 修改 * 正则修改 * 正则修改 * 正则修改 Co-authored-by: xujiahao01 <xujiahao01@baidu.com>
This commit is contained in:
parent
25a8fe2f48
commit
8fc6d45b4d
@ -170,8 +170,8 @@ export default class Collapse extends React.Component<CollapseProps, {}> {
|
||||
propsUpdate={propsUpdate}
|
||||
expandIcon={
|
||||
expandIcon
|
||||
? typeof expandIcon === 'object'
|
||||
? generateIcon(cx, expandIcon as IconCheckedSchema)
|
||||
? typeof (expandIcon as any).icon === 'object'
|
||||
? generateIcon(cx, (expandIcon as any).icon)
|
||||
: render('arrow-icon', expandIcon || '', {
|
||||
className: cx('Collapse-icon-tranform')
|
||||
})
|
||||
|
@ -290,11 +290,9 @@ export default class NumberControl extends React.Component<
|
||||
}
|
||||
|
||||
componentDidUpdate(prevProps: NumberProps) {
|
||||
if (
|
||||
!isNaN(this.props.value) &&
|
||||
!isNaN(prevProps.value) &&
|
||||
this.props.value !== prevProps.value
|
||||
) {
|
||||
// 匹配 数字 + ?字符
|
||||
const reg = /^([-+]?(([1-9]\d*\.?\d*)|(0\.\d*[1-9]))[^\d\.]*)$/;
|
||||
if (reg.test(this.props.value) && this.props.value !== prevProps.value) {
|
||||
const unit = this.getUnit();
|
||||
this.setState({unit: unit});
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user