SiteOptions

This commit is contained in:
cxc
2022-07-26 17:31:19 +08:00
parent 2f2d61385c
commit 488071ab2b
8 changed files with 254 additions and 143 deletions

20
src/store/modules/data.js Normal file
View File

@ -0,0 +1,20 @@
import { defineStore } from "pinia";
const useDataStore = defineStore("data", {
state: () => ({
siteList: [],
}),
getters: {
getSiteName: (state) => {
return (siteId) =>
state.siteList.find((el) => el.id === siteId)?.name || "无";
},
},
actions: {
setSiteList(list) {
this.siteList = list;
},
},
});
export default useDataStore;