Open n0099 opened 1 week ago
Stackblitz link for the reproduction: Stackblitz
Looks like a complex app. Would you be able to provide a minimal reproduction? 🙏
Would you be able to provide a reproduction? 🙏
scroll to the bottom of page and click the button with text
下一页
In fact this step should be repeated two times, the first time to click that button won't trigger this.
I fixed this by changing the inline-function
style v-on
event handler on that button which wrapping an async function with plain method
or inline
handler:
-@clickNextPage="async () => await fetchNextPage()"
+@clickNextPage="fetchNextPage()"
+@clickNextPage="fetchNextPage"
I fixed this by changing...
It's still reproducible :(
You should not call use useRoute in a click handler. Call it in your setup function and use the route object in the click handler
useRoute in a click handler
I'm not. https://github.com/n0099/open-tbm/blob/e7c516a2ac5bad2e726074fe9155c9b93c940df0/fe/src/components/post/badge/Common.vue#L49 It's in a <script setup>
of SFC.
(Just mentioned in case. I'm still waiting for a minimal reproduction to check in more detail.)
~It seems that prevent re-render <NuxtPage>
when changing route can fix this even with @clickNextPage="async () => await fetchNextPage()"
~
- <NuxtPage />
+ <NuxtPage :pageKey="route => route.path.split('/')[1]" />
No it's still reproducible. About minimal reprod: I tried to make one: https://codesandbox.io/p/devbox/new-water-vxj48t but it won't reproduce.
Environment
Reproduction
access https://localhost/tbm/posts/fid/228500/cursor/vNcpHQI,bLKIZg,lMJmGCM,mKqzZg,W3eEFSM,kuKoZg in browser and open devtools scroll to the bottom of page and click the button with text
下一页
you can see manyconsole.warn()
with callstack at https://github.com/n0099/open-tbm/blob/e7c516a2ac5bad2e726074fe9155c9b93c940df0/fe/src/components/post/badge/Common.vue#L49Describe the bug
https://github.com/nuxt/nuxt/blob/d5cf409ddca078266bd71ca011b9bc6ed6e58e05/packages/nuxt/src/app/composables/router.ts#L21-L22 https://github.com/nuxt/nuxt/blob/d5cf409ddca078266bd71ca011b9bc6ed6e58e05/packages/nuxt/src/app/composables/router.ts#L81-L84 https://github.com/nuxt/nuxt/blob/d5cf409ddca078266bd71ca011b9bc6ed6e58e05/packages/nuxt/src/pages/runtime/plugins/router.ts#L193 https://github.com/nuxt/nuxt/blob/d5cf409ddca078266bd71ca011b9bc6ed6e58e05/packages/nuxt/src/app/plugins/router.ts#L245
Additional context
No response
Logs
No response