ts循环生成div

subRow = (data: object[]) => {
const {
rowNum, height, offset
}: Proper = this.props.properties
console.log(data)
// const ArrItem: Array<JSX.Element> = []
// data.map((item) => (
// ArrItem.push((
// <Col span={24 / rowNum} offset={offset} style={{ height }} className="col">
// 栅格图片
//
// ))
// ))
return data.map((item: any) => {
const itemss: object = {
items: [item]
}
return (
<Col span={24 / rowNum} offset={offset} style={{ height }} className="over">
{
this.renderSubWidget('item_widget', {
__key: item.id,
__result: itemss,
__listType: 'div',
onItemClick: this.onItemClick
})
}

)
})
// return ArrItem.map((item): JSX.Element => item)
}

posted @ 2021-06-01 17:42  无情的皮卡丘  阅读(519)  评论(0编辑  收藏  举报