Skip to content

Commit

Permalink
chore: refine type
Browse files Browse the repository at this point in the history
  • Loading branch information
hunterliu1003 committed Jan 29, 2024
1 parent 5081259 commit 7444b8a
Showing 1 changed file with 3 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,8 +48,8 @@ export function useTransition(
const [contentVisible, contentState, contentListeners] = useTransitionState(visible.value)
const [overlayVisible, overlayState, overlayListeners] = useTransitionState(visible.value)

const contentTransition = computed<TransitionProps>(() => mergeTransition(props.contentTransition))
const overlayTransition = computed<TransitionProps>(() => mergeTransition(props.overlayTransition))
const contentTransition = computed(() => mergeTransition(props.contentTransition))
const overlayTransition = computed(() => mergeTransition(props.overlayTransition))

const isReadyToBeDestroyed = computed(() =>
(props.hideOverlay || overlayState.value === TransitionState.Leave)
Expand Down Expand Up @@ -110,7 +110,7 @@ export function useTransition(
}
}

function mergeTransition(transition?: VfmTransition | TransitionProps) {
function mergeTransition(transition?: VfmTransition | TransitionProps): TransitionProps {
if (typeof transition === 'string')
return { name: transition, appear: true }
return { appear: true, ...transition }
Expand Down

0 comments on commit 7444b8a

Please sign in to comment.