mirror of
https://gitee.com/baidu/amis.git
synced 2024-11-30 02:48:55 +08:00
fix(amis): flex组件/合并flex和flexBasis,并优先使用flexBasis
This commit is contained in:
parent
d00cfbee7b
commit
92d24f9680
@ -112,6 +112,14 @@ export default class Flex extends React.Component<FlexProps, object> {
|
||||
...styleVar
|
||||
};
|
||||
|
||||
if (flexStyle.flexBasis !== undefined && flexStyle.flex) {
|
||||
// 合并flex和flexBasis,并优先使用flexBasis
|
||||
const flexValArr = flexStyle.flex.split(' ');
|
||||
flexStyle.flex = `${flexValArr[0]} ${flexValArr[1] || flexValArr[0]} ${
|
||||
flexStyle.flexBasis
|
||||
}`;
|
||||
}
|
||||
|
||||
return (
|
||||
<div style={flexStyle} className={className}>
|
||||
{(Array.isArray(items) ? items : items ? [items] : []).map(
|
||||
|
Loading…
Reference in New Issue
Block a user