You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 
 
 
 

31 lines
879 B

import type { TransitionSetting } from '@/types/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
}
}