Files
vue-vben-admin/src/hooks/setting/useTransitionSetting.ts
xingyu 4d2fb0cb6f refactor: '/@/' ==> '@/' and '/#/ '==> '#/' (#3329)
* refactor: /@/ ==> @/

* chore: '/@/' ==> '@/' and '/#/ '==> '#/'

* fix: lint:prettier
2023-11-24 10:32:04 +08:00

32 lines
885 B
TypeScript

import type { TransitionSetting } from '#/config';
import { computed } from 'vue';
import { useAppStore } from '@/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,
};
}