SiteOptions
This commit is contained in:
20
src/store/modules/data.js
Normal file
20
src/store/modules/data.js
Normal 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;
|
Reference in New Issue
Block a user