Add empty list item and expand menu by default

This commit is contained in:
Yang Luo
2023-04-10 01:57:53 +08:00
parent ebe8ad8669
commit 0db61dd658
3 changed files with 50 additions and 32 deletions

View File

@ -19,8 +19,12 @@ import {LayoutOutlined} from "@ant-design/icons";
class ChatMenu extends React.Component {
constructor(props) {
super(props);
const items = this.chatsToItems(this.props.chats);
const openKeys = items.map((item) => item.key);
this.state = {
openKeys: ["0"],
openKeys: openKeys,
selectedKeys: ["0-0"],
};
}