refactor: Separate store

This commit is contained in:
vben
2024-07-30 21:10:28 +08:00
parent cf0ec053e4
commit 89dcf522f5
40 changed files with 338 additions and 345 deletions

View File

@@ -1,18 +1 @@
import type { InitStoreOptions } from '@vben/stores';
import type { App } from 'vue';
import { initStore, resetAllStores, storeToRefs } from '@vben/stores';
/**
* @zh_CN 初始化pinia
* @param app vue app 实例
*/
async function setupStore(app: App, options: InitStoreOptions) {
const pinia = await initStore(options);
app.use(pinia);
}
export { resetAllStores, setupStore, storeToRefs };
export { useAccessStore } from './modules/access';
export * from './auth';