From 97a133fa43f815c7e84775227afca99c78b8abb9 Mon Sep 17 00:00:00 2001 From: tmg0 Date: Mon, 27 May 2024 14:11:06 +0800 Subject: [PATCH] fix: tansition back to small one --- src/composables/use-hero.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/composables/use-hero.ts b/src/composables/use-hero.ts index d29a063..d3cd210 100644 --- a/src/composables/use-hero.ts +++ b/src/composables/use-hero.ts @@ -9,8 +9,8 @@ import { useHeroContext } from '../composables/use-hero-context' export type UseHeroProps = Omit export const defaultTransition = { - type: 'spring', - duration: 800, + type: 'keyframes', + duration: 300, } export function useHero(domRef: Ref, props: UseHeroProps) { @@ -54,7 +54,7 @@ export function useHero(domRef: Ref, props: UseHeroProps) { await nextTick() const initial = { ...unref(prev), x: `${_x}px`, y: `${_y}px`, width: prev.value.width, height: prev.value.height } - const enter = { ...style.value, x: 0, y: 0, width: bounding.width, height: bounding.height, transition: transition.value } + const enter = { ...style.value, x: 0, y: 0, width: bounding.width, height: bounding.height, transition: unref(transition) } motionInstance = useMotion(domRef, { initial: omit(initial, props.ignore),