mirror of
https://github.com/jeecgboot/JeecgBoot.git
synced 2025-12-08 17:12:28 +08:00
v3.7.2 版本代码合并
This commit is contained in:
@ -1,9 +1,19 @@
|
||||
import type { App } from 'vue';
|
||||
import type { Pinia } from 'pinia';
|
||||
import { createPinia } from 'pinia';
|
||||
const store = createPinia();
|
||||
|
||||
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 };
|
||||
|
||||
Reference in New Issue
Block a user