mirror of
https://github.com/soybeanjs/soybean-admin.git
synced 2025-09-22 19:46:38 +08:00
26 lines
546 B
TypeScript
26 lines
546 B
TypeScript
import type { Ref } from 'vue';
|
|
import { defineStore } from 'pinia';
|
|
import { useReload } from '@/hooks';
|
|
|
|
interface AppStore {
|
|
/** 重载页面的标志 */
|
|
reloadFlag: Ref<boolean>;
|
|
/**
|
|
* 触发重载页面
|
|
* @param duration - 延迟时间(ms, 默认0)
|
|
*/
|
|
handleReload(duration?: number): void;
|
|
}
|
|
|
|
export const useAppStore = defineStore('app-store', () => {
|
|
// 重新加载页面
|
|
const { reloadFlag, handleReload } = useReload();
|
|
|
|
const appStore: AppStore = {
|
|
reloadFlag,
|
|
handleReload
|
|
};
|
|
|
|
return appStore;
|
|
});
|