mirror of
https://github.com/BTMuli/TeyvatGuide.git
synced 2026-04-02 06:45:08 +08:00
✨ 存储分区信息
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
/**
|
||||
* @file store/modules/app.ts
|
||||
* @description App store module
|
||||
* @since Beta v0.7.2
|
||||
* @since Beta v0.7.3
|
||||
*/
|
||||
|
||||
import { path } from "@tauri-apps/api";
|
||||
@@ -131,13 +131,9 @@ export const useAppStore = defineStore(
|
||||
"shareDefaultFile",
|
||||
"imageQualityPercent",
|
||||
"incognito",
|
||||
"sidebar",
|
||||
],
|
||||
},
|
||||
{
|
||||
key: "sidebar",
|
||||
storage: window.localStorage,
|
||||
pick: ["sidebar"],
|
||||
},
|
||||
{
|
||||
key: "theme",
|
||||
storage: window.localStorage,
|
||||
|
||||
27
src/store/modules/bbs.ts
Normal file
27
src/store/modules/bbs.ts
Normal file
@@ -0,0 +1,27 @@
|
||||
/**
|
||||
* @file store/modules/bbs.ts
|
||||
* @description BBS 模块状态管理
|
||||
* @since Beta v0.7.3
|
||||
*/
|
||||
import { defineStore } from "pinia";
|
||||
import { shallowRef } from "vue";
|
||||
|
||||
import apiHubReq from "@/web/request/apiHubReq.js";
|
||||
|
||||
const useBBSStore = defineStore(
|
||||
"bbs",
|
||||
() => {
|
||||
// 游戏列表
|
||||
const gameList = shallowRef<Array<TGApp.BBS.Game.Item>>([]);
|
||||
|
||||
// 刷新游戏列表
|
||||
async function refreshGameList(): Promise<void> {
|
||||
gameList.value = await apiHubReq.game();
|
||||
}
|
||||
|
||||
return { gameList, refreshGameList };
|
||||
},
|
||||
{ persist: true },
|
||||
);
|
||||
|
||||
export default useBBSStore;
|
||||
Reference in New Issue
Block a user