fix:房间号更新改为pinia

This commit is contained in:
2026-05-07 17:15:28 +08:00
parent 29a6f46a0d
commit 8c66ef78c6
3 changed files with 28 additions and 21 deletions

View File

@@ -79,6 +79,7 @@ export default defineStore("store", {
game: {
roomID: "",
inBattle: false,
roomNumber: "", // 当前房间号,供 Header 展示房号胶囊
},
}),
@@ -135,6 +136,10 @@ export default defineStore("store", {
this.game.roomID = roomID;
this.game.inBattle = inBattle;
},
/** 更新当前房间号,供 Header 组件展示房号胶囊 */
updateRoomNumber(number) {
this.game.roomNumber = number;
},
},
// 开启数据持久化