matrix
安装
yarn add grid-matrix 或 npm install grid-matrix
使用
const Item = { const src = props return <div>srcaa</div> } const dataSources = aa:1 aa:2aa:1 aa:2aa:1 aa:2 Component { return <Matrix dataSources=dataSources> <Item /> </Matrix> }
一行个数自由配置
<Matrix dataSources=dataSources length=6> <Item /></Matrix>
增加了gutter
可以自由改变间距
<Matrix dataSources=dataSources gutter=20> <Item /></Matrix>
api
dataSources: 用于渲染的源数据,默认为空数组[]
length: 一行的长度,默认是4
Item会接受src
作为props,src
为dataSources的每一个数据 gutter 数字 可以设置间距 className 类名