添加分享房间链接和对战结束返回房间
This commit is contained in:
10
src/store.js
10
src/store.js
@@ -2,7 +2,7 @@ import { defineStore } from "pinia";
|
||||
|
||||
const defaultUser = {
|
||||
id: "",
|
||||
nickName: "游客",
|
||||
nickName: "",
|
||||
avatar: "../static/user-icon.png",
|
||||
trio: 0, // 大于1表示完成了新手引导
|
||||
lvlName: "",
|
||||
@@ -50,6 +50,10 @@ export default defineStore("store", {
|
||||
ringRank: [],
|
||||
},
|
||||
online: false,
|
||||
game: {
|
||||
roomID: "",
|
||||
inBattle: false,
|
||||
},
|
||||
}),
|
||||
|
||||
// 计算属性
|
||||
@@ -103,6 +107,10 @@ export default defineStore("store", {
|
||||
this.config.randInfos
|
||||
);
|
||||
},
|
||||
updateGame(inBattle = false, roomID = "") {
|
||||
this.game.roomID = roomID;
|
||||
this.game.inBattle = inBattle;
|
||||
},
|
||||
},
|
||||
|
||||
// 开启数据持久化
|
||||
|
||||
Reference in New Issue
Block a user