优化 checkboxes 中options长度不是columnsCount整数倍时最后一列布局不一致问题

This commit is contained in:
catchonme 2019-05-28 15:27:31 +08:00
parent 86878db288
commit 3d59be2b3b

View File

@ -82,8 +82,8 @@ export default class CheckboxesControl extends React.Component<CheckboxesProps,
let cellClassName = `${ns}Grid-col--sm${weight === Math.round(weight) ? weight : ''}`;
body = chunk(body, columnsCount).map((group, groupIndex) => (
<div className={`${ns}Grid`} key={groupIndex}>
{group.map((item, index) => (
<div key={index} className={cellClassName}>{item}</div>
{Array.from({length: columnsCount as number}).map((_, index) => (
<div key={index} className={cellClassName}>{group[index]}</div>
))}
</div>
));