Files
my-spring/web-vue/packages/core/hooks/setting/useTransitionSetting.ts

33 lines
917 B
TypeScript
Raw Normal View History

2026-03-19 10:57:24 +08:00
import type { TransitionSetting } from '@jeesite/types/config';
import { computed } from 'vue';
import { useAppStore } from '@jeesite/core/store/modules/app';
export function useTransitionSetting() {
const appStore = useAppStore();
const getEnableTransition = computed(() => appStore.getTransitionSetting?.enable);
// const getOpenNProgress = computed(() => appStore.getTransitionSetting?.openNProgress);
const getOpenPageLoading = computed((): boolean => {
return !!appStore.getTransitionSetting?.openPageLoading;
});
const getBasicTransition = computed(() => appStore.getTransitionSetting?.basicTransition);
function setTransitionSetting(transitionSetting: Partial<TransitionSetting>) {
appStore.setProjectConfig({ transitionSetting });
}
return {
setTransitionSetting,
getEnableTransition,
// getOpenNProgress,
getOpenPageLoading,
getBasicTransition,
};
}