create-iking-admin
Version:
金合技术中台脚手架
32 lines (22 loc) • 924 B
text/typescript
import type { TransitionSetting } from '@t/config';
import { computed } from 'vue';
import { useAppStore } from '@/global/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,
};
}