我使用的是React的Ant设计。我在Ant Design dropdown组件中使用了Ant Design list组件。
代码运行没有问题,但我在控制台中收到两个错误!
class App extends Component {
state = {
notifData: [
{ title: "Ant Design Title 1" },
{ title: "Ant Design Title 2" },
{ title: "Ant Design Title 3" },
{ title: "Ant Design Title 4" }
]
};
render() {
const headerNotifDropdown = (
<List
itemLayout="horizontal"
dataSource={this.state.notifData}
renderItem={item => (
<List.Item>
<List.Item.Meta
avatar={<Avatar icon="user" />}
title={item.title}
description="Ant Design, a design language for background applications, is refined by Ant UED Team"
/>
</List.Item>
)}
/>
);
return (
<ul>
<li>
<Dropdown overlay={headerNotifDropdown} trigger={["click"]}>
<a href="#notif">
<Badge count={5}>
<Icon type="notification" />
</Badge>
</a>
</Dropdown>
</li>
</ul>
);
}
}有人能帮帮忙吗?
https://stackoverflow.com/questions/56215558
复制相似问题