-
-
Notifications
You must be signed in to change notification settings - Fork 8.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[bug] Lifecycle hooks has been called twice in HMR when I use "v-for + ref" and "script setup" in RouterView. #7908
Comments
Thanks very much, it took me a while to before I checked the chrome dev tools. |
I did simplify the code by removing line 12: |
Fix the problem. I believe that setup(){} function helped somewhat. The setup function is only executed only one in vue.js 3, if I am correct. https://stackblitz.com/edit/vitejs-vite-nzzz5i?file=src%2Fviews%2FHelloWorld.vue |
…uld not allow recursing (fix vuejs#7908)
I am facing this issue even without |
Upvote this issue, I still reproduce using latest Vue version. |
I'm facing this issue for each function call . |
The issue can no longer be reproduced using the latest version of Vue. |
Vue version
3.2.45
Link to minimal reproduction
https://stackblitz.com/edit/vitejs-vite-fx7e3m?file=src/views/HelloWorld.vue
Steps to reproduce
vue-router
RouterView
v-for + ref
attribute on the html elementref attribute
<script setup>
to triggerhot module replacement
What is expected?
onMounted will be Called once
What is actually happening?
onMounted will be Called twice.
System Info
"mounted" will be print twice on the browser console
Any additional comments?
The text was updated successfully, but these errors were encountered: