feat: 对接chathub用户列表

This commit is contained in:
橙子
2024-04-04 19:28:18 +08:00
parent b57d56f317
commit 43b4032bbb
16 changed files with 302 additions and 16 deletions

View File

@@ -0,0 +1,28 @@
import { defineStore } from "pinia";
const chatStore = defineStore("chat", {
state: () => ({
userList: [],
}),
// getters: {
// userListData: (state) => state.userList,
// },
actions: {
// 设置在线总数
setUserList(value) {
this.userList = value;
},
addUser(user)
{
this.userList.push(user);
},
delUser(userId)
{
this.userList = this.userList.filter(obj => obj.userId != userId);
}
},
});
export default chatStore;