Files
lanecarford_front/src/stores/modules/overall.ts
2025-10-23 14:05:42 +08:00

20 lines
416 B
TypeScript
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
// 每一个存储的模块命名规则use开头store结尾
import { defineStore } from 'pinia'
export const useOverallStore = defineStore({
id: 'overall', // 必须指明唯一的pinia仓库的id
state: () => {
return {
loading:false,
}
},
getters: {
// doubleCount: (state) => state.num * 2
},
actions: {
// 全局loading
setLoading(data:boolean){
this.loading = data
}
}
})