Files
FiDA_Front/src/stores/global.ts

21 lines
609 B
TypeScript
Raw Normal View History

2026-02-02 13:32:33 +08:00
import { defineStore } from 'pinia'
import { ref, computed } from 'vue'
export const useGlobalStore = defineStore('global', () => {
const state = ref({
2026-02-03 11:11:04 +08:00
loading: false,// 全局loading
2026-02-04 11:27:45 +08:00
view_loading: false,// 页面跳转loading
2026-02-03 11:11:04 +08:00
homeLeftNavCollapse: false,// 首页左侧导航是否折叠
2026-02-02 13:32:33 +08:00
})
const setLoading = (v: boolean) => { state.value.loading = v }
2026-02-04 11:27:45 +08:00
const setViewLoading = (v: boolean) => { state.value.view_loading = v }
2026-02-03 11:11:04 +08:00
const setHomeLeftNavCollapse = (v: boolean) => { state.value.homeLeftNavCollapse = v }
2026-02-02 13:32:33 +08:00
return {
state,
setLoading,
2026-02-04 11:27:45 +08:00
setViewLoading,
2026-02-03 11:11:04 +08:00
setHomeLeftNavCollapse,
2026-02-02 13:32:33 +08:00
}
})