mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2025-12-08 17:12:28 +08:00
20 lines
350 B
Vue
20 lines
350 B
Vue
import type { App } from 'vue';
|
|
import type { Pinia } from 'pinia';
|
|
import { createPinia } from 'pinia';
|
|
|
|
let store: Nullable<Pinia> = null;
|
|
|
|
export function setupStore(app: App<Element>) {
|
|
if (store == null) {
|
|
store = createPinia();
|
|
}
|
|
app.use(store);
|
|
}
|
|
|
|
// 销毁store
|
|
export function destroyStore() {
|
|
store = null;
|
|
}
|
|
|
|
export { store };
|