We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 13393b1 commit e866592Copy full SHA for e866592
packages/core/useAnimate/index.ts
@@ -233,15 +233,17 @@ export function useAnimate(
233
})
234
235
watch(() => keyframes, (value) => {
236
- if (animate.value)
+ if (animate.value) {
237
update()
238
239
- if (!unrefElement(target) && animate.value) {
240
- animate.value.effect = new KeyframeEffect(
241
- unrefElement(target)!,
242
- toValue(value),
243
- animateOptions,
244
- )
+ const targetEl = unrefElement(target)
+ if (targetEl) {
+ animate.value.effect = new KeyframeEffect(
+ targetEl,
+ toValue(value),
+ animateOptions,
245
+ )
246
+ }
247
}
248
}, { deep: true })
249
0 commit comments