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}
|
propsUpdate={propsUpdate}
|
||||||
expandIcon={
|
expandIcon={
|
||||||
expandIcon
|
expandIcon
|
||||||
? typeof expandIcon === 'object'
|
? typeof (expandIcon as any).icon === 'object'
|
||||||
? generateIcon(cx, expandIcon as IconCheckedSchema)
|
? generateIcon(cx, (expandIcon as any).icon)
|
||||||
: render('arrow-icon', expandIcon || '', {
|
: render('arrow-icon', expandIcon || '', {
|
||||||
className: cx('Collapse-icon-tranform')
|
className: cx('Collapse-icon-tranform')
|
||||||
})
|
})
|
||||||
|
@ -290,11 +290,9 @@ export default class NumberControl extends React.Component<
|
|||||||
}
|
}
|
||||||
|
|
||||||
componentDidUpdate(prevProps: NumberProps) {
|
componentDidUpdate(prevProps: NumberProps) {
|
||||||
if (
|
// 匹配 数字 + ?字符
|
||||||
!isNaN(this.props.value) &&
|
const reg = /^([-+]?(([1-9]\d*\.?\d*)|(0\.\d*[1-9]))[^\d\.]*)$/;
|
||||||
!isNaN(prevProps.value) &&
|
if (reg.test(this.props.value) && this.props.value !== prevProps.value) {
|
||||||
this.props.value !== prevProps.value
|
|
||||||
) {
|
|
||||||
const unit = this.getUnit();
|
const unit = this.getUnit();
|
||||||
this.setState({unit: unit});
|
this.setState({unit: unit});
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user