module: react-grid-layout
version: ^0.18.3
import {WidthProvider, Responsive} from 'react-grid-layout';
const ResponsiveReactGridLayout = WidthProvider (Responsive);
// 属性配置
const GridProps = {
cols: {lg: 12, md: 10, sm: 6, xs: 4, xxs: 2},
rowHeight: 10,
margin: [10, 10],
containerPadding: [10, 10],
totalColumn: 12,
};
<ResponsiveReactGridLayout
className="layout"
{...GridProps}
onLayoutChange={(layout, layouts) =>
this.onLayoutChange (layout, layouts)}
>
{this.generateDOM ()}
</ResponsiveReactGridLayout>
margin: [10, 10], 导致ResponsiveReactGridLayout内部每一个元素的高度都变的更高了, 不知道原因, 有没有大神用过.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…