Skip to content
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

fix: handle v-for + custom directive should trigger unmounted #12572

Closed

Conversation

linzhe141
Copy link
Contributor

@linzhe141 linzhe141 commented Dec 18, 2024

close #12569

try to simulate this case using component
image

In this issue, if I use a component to simulate this case, vue can trigger the component's onUnmounted hook, because when collecting dynamicChildren, ShapeFlags.COMPONENT is always collected.

(vnode.patchFlag > 0 || shapeFlag & ShapeFlags.COMPONENT) &&

So I think if vnode uses runtime dirctives, it should also be collected into dynamicChildren,Or mark this v-for fragment as not STABLE_FRAGMENT?

Copy link

github-actions bot commented Dec 18, 2024

Size Report

Bundles

File Size Gzip Brotli
runtime-dom.global.prod.js 100 kB (+35 B) 38 kB (+24 B) 34.2 kB (+38 B)
vue.global.prod.js 158 kB (+35 B) 57.8 kB (+23 B) 51.5 kB (+51 B)

Usages

Name Size Gzip Brotli
createApp (CAPI only) 46.6 kB 18.3 kB 16.7 kB
createApp 54.6 kB 21.3 kB 19.4 kB
createSSRApp 58.7 kB 23 kB 20.9 kB
defineCustomElement 59.4 kB 22.8 kB 20.8 kB
overall 68.4 kB 26.4 kB 24 kB

Copy link

pkg-pr-new bot commented Dec 18, 2024

Open in Stackblitz

@vue/compiler-core

npm i https://pkg.pr.new/@vue/compiler-core@12572

@vue/compiler-dom

npm i https://pkg.pr.new/@vue/compiler-dom@12572

@vue/compiler-ssr

npm i https://pkg.pr.new/@vue/compiler-ssr@12572

@vue/compiler-sfc

npm i https://pkg.pr.new/@vue/compiler-sfc@12572

@vue/reactivity

npm i https://pkg.pr.new/@vue/reactivity@12572

@vue/runtime-core

npm i https://pkg.pr.new/@vue/runtime-core@12572

@vue/runtime-dom

npm i https://pkg.pr.new/@vue/runtime-dom@12572

@vue/server-renderer

npm i https://pkg.pr.new/@vue/server-renderer@12572

@vue/shared

npm i https://pkg.pr.new/@vue/shared@12572

vue

npm i https://pkg.pr.new/vue@12572

@vue/compat

npm i https://pkg.pr.new/@vue/compat@12572

commit: 7c145d6

@linzhe141 linzhe141 marked this pull request as draft December 18, 2024 06:33
@linzhe141 linzhe141 marked this pull request as ready for review December 18, 2024 07:54
@linzhe141 linzhe141 closed this Dec 18, 2024
@linzhe141 linzhe141 reopened this Dec 18, 2024
@linzhe141 linzhe141 changed the title fix: handle v-for + custom directive fix: handle v-for + custom directive should trigger unmounted Dec 19, 2024
@edison1105
Copy link
Member

see #12569 (comment)

@linzhe141 linzhe141 marked this pull request as draft December 19, 2024 08:09
@linzhe141 linzhe141 closed this Dec 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Custom directive's unmounted event is not triggered on v-for element
2 participants