React does not recognize the `colStyle` prop on a DOM element. If you intent

时间:2020-05-23
本文章向大家介绍React does not recognize the `colStyle` prop on a DOM element. If you intent,主要包括React does not recognize the `colStyle` prop on a DOM element. If you intent使用实例、应用技巧、基本知识点总结和需要注意事项,具有一定的参考价值,需要的朋友可以参考一下。

在ant的List组件中,使用了其他组件(可以使用其他组件,但要在合适的位置),应该是在List中的List.Item标签中使用其他组件

 <List
            grid={{
                gutter: 16,
                xs: 1,
                sm: 2,
                md: 4,
                lg: 4,
                xl: 6,
                xxl: 3,
            }}
            // itemLayout="vertical"
            size="large"
            pagination={{
                onChange: page => {
                    console.log(page);
                },
                pageSize: 2
            }}
            dataSource={listData}
            footer={
                <div>
                    <b>ant design</b>
                </div>
            }
            renderItem={item => (
                <List.Item>
                    <Card
                        hoverable
                        style={{ width: 240 }}
                        cover={<img alt="example" src="https://os.alipayobjects.com/rmsportal/QBnOOoLaAfKPirc.png" />}
                    >
                        <Meta title="Europe Street beat" description="www.instagram.com" />
                    </Card>
                </List.Item>

            )}
        />

列表加卡片,就完成了

原文地址:https://www.cnblogs.com/zqblog1314/p/12943858.html