-
-
Notifications
You must be signed in to change notification settings - Fork 8.4k
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
Vue component don't render properly in dev mode #6978
Comments
It could be a bug about hmr. |
I think I've found the bug, when -- Doesn't works when you move
-- But, if the list has no child and move
😌 |
As shown above, the most fundamental reason for this is that the children of each blue div are all equal to the same array due to the red div being hoisted. hmr may cause other elements to be added to the red div, and since the vnode.el corresponding to all red divs is equal to the same value, the newly added elements end up being added to the last red div. <template>
<div v-for="item in 3" :key="item" class="blue">
<div class="red">
</div>
</div>
</template> |
in this situation, i think we should unmount preVNode, see https://github.com/vuejs/core/pull/6988/files |
I'm seeing others issues related. If you remove the comment, next remove the empty element inside list, the element keep present in the list and when you undo the change, the element now is duplicated. |
Same issue here 🤐 |
Months have passed, but there has been no progress. |
There is already a PR for this issue but it needs approval 🫠 |
Vue version
3.2.41
Link to minimal reproduction
https://stackblitz.com/edit/vitejs-vite-wbtxfm?file=tailwind.config.cjs,src%2FApp.vue,src%2FNormalComponent.vue,package.json
Steps to reproduce
<NormalComponent />
component bellow the comment<!-- MOVE <NormalComponent /> BELLOW THIS COMMENT -->
Wrong rendered list
Correct rendered list after refresh.
What is expected?
I expect to get the list rendered correctly.
What is actually happening?
List don't render properly after move NormalComponent inside list
Wrong rendered list
System Info
Any additional comments?
No response
The text was updated successfully, but these errors were encountered: