mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-08-26 16:46:19 +08:00
perf: Improve the use of store in the app
This commit is contained in:
20
apps/web-antd/src/store/modules/app.ts
Normal file
20
apps/web-antd/src/store/modules/app.ts
Normal file
@@ -0,0 +1,20 @@
|
||||
import { useCoreAccessStore, useCoreTabbarStore } from '@vben-core/stores';
|
||||
|
||||
import { defineStore } from 'pinia';
|
||||
|
||||
export const useAppStore = defineStore('app', () => {
|
||||
const coreStoreAccess = useCoreAccessStore();
|
||||
const coreTabbarStore = useCoreTabbarStore();
|
||||
|
||||
/**
|
||||
* 重置所有 状态
|
||||
*/
|
||||
async function resetAppState() {
|
||||
coreStoreAccess.$reset();
|
||||
coreTabbarStore.$reset();
|
||||
}
|
||||
|
||||
return {
|
||||
resetAppState,
|
||||
};
|
||||
});
|
Reference in New Issue
Block a user