chore: update watch

This commit is contained in:
userquin 2023-02-10 22:28:53 +01:00
parent 3270140c3f
commit a7414bb59e

View file

@ -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)) if (trackEnabled && (!r.meta || !r.meta?.noScrollTrack))
storage.value[r.fullPath] = Math.floor(scrollPosition) storage.value[r.fullPath] = Math.floor(scrollPosition)
}, { immediate: true, flush: 'pre' }) }, { immediate: true, flush: 'pre' })