From a7414bb59e4fabce5cf448d2d7442ddd6674a3fb Mon Sep 17 00:00:00 2001 From: userquin Date: Fri, 10 Feb 2023 22:28:53 +0100 Subject: [PATCH] chore: update watch --- plugins/track-scroll-position.client.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plugins/track-scroll-position.client.ts b/plugins/track-scroll-position.client.ts index 85a8917a..041ee2c9 100644 --- a/plugins/track-scroll-position.client.ts +++ b/plugins/track-scroll-position.client.ts @@ -58,7 +58,7 @@ export default defineNuxtPlugin((nuxtApp) => { } }) - watch(() => [track.value, y.value, route], ([trackEnabled, scrollPosition, r]) => { + watch([track, y, () => route], ([trackEnabled, scrollPosition, r]) => { if (trackEnabled && (!r.meta || !r.meta?.noScrollTrack)) storage.value[r.fullPath] = Math.floor(scrollPosition) }, { immediate: true, flush: 'pre' })