Join GitHub today
`beforeUpdate` is not called if we explicitly state `v-slot:default` #10986
Steps to reproduce
Click on the gray box under "With `v-slot:default`:"
What is expected?
What is actually happening?
It is NOT called.
Under "No `v-slot`:" there is an identical component, except it lacks
maybe some more useful info:
While testing the failing component in the original example, on this line, https://github.com/vuejs/vue/blob/dev/src/core/instance/lifecycle.js#L200,
I'm pretty new to the source code so I'm not exactly sure where we these components get extended. I'm guessing its happening in `/src/core/instance/init.js' but maybe someone more familiar can point me closer.
i looked into this a little more
It looks like the Dep being created for beforeUpdateCallCount is not being set correctly with the 'with-v-slot' component.
'my-component-with-slot' is being added as a sub to the Dep for that variable but 'with-v-slot' is not. i.e, the update to that value is not going beyond 'my-component-with-slot'
there are two separate Dep's being created for that beforeUpdateCallCount variable. so I can see it adding 'with-v-slot' as a sub, but when the actual click handler happens and the value changes, the wrong Dep is sending notifications. i can tell because this.uid in the Dep does not match the Dep that 'with-v-slot' is subscribed to
Is this actually a bug?
Not calling these hooks is then correct following the lifecycle
This actually ties in with my feature request #9756, parents don't have to update with scoped slots so you get better performance.
@KaelWD You are right,
Sounds confusing to me.