定义全局loding

This commit is contained in:
X1627315083
2025-10-23 14:05:42 +08:00
parent dab0bfaa5e
commit c454a16f04
4 changed files with 44 additions and 2 deletions

View File

@@ -0,0 +1,19 @@
// 每一个存储的模块命名规则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
}
}
})