mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-08-26 16:46:19 +08:00
34 lines
1000 B
TypeScript
34 lines
1000 B
TypeScript
import type { TransitionSetting } from '/@/types/config';
|
|
|
|
import { computed, unref } from 'vue';
|
|
|
|
import { appStore } from '/@/store/modules/app';
|
|
|
|
export function useTransitionSetting() {
|
|
const getTransitionSetting = computed(() => appStore.getProjectConfig.transitionSetting);
|
|
|
|
const getEnableTransition = computed(() => unref(getTransitionSetting).enable);
|
|
|
|
const getOpenNProgress = computed(() => unref(getTransitionSetting)?.openNProgress);
|
|
|
|
const getOpenPageLoading = computed(() => {
|
|
return unref(getTransitionSetting)?.openPageLoading && unref(getEnableTransition);
|
|
});
|
|
|
|
const getBasicTransition = computed(() => unref(getTransitionSetting)?.basicTransition);
|
|
|
|
function setTransitionSetting(transitionSetting: Partial<TransitionSetting>) {
|
|
appStore.commitProjectConfigState({ transitionSetting });
|
|
}
|
|
|
|
return {
|
|
setTransitionSetting,
|
|
|
|
getTransitionSetting,
|
|
getEnableTransition,
|
|
getOpenNProgress,
|
|
getOpenPageLoading,
|
|
getBasicTransition,
|
|
};
|
|
}
|