You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In the Child.vue we have a slot with a default slot content. In the Parent.vue we override the default content of the child.
What is expected?
IMO the content of the slot in child component should not be evaluated since the content provided from the parent will be used.
What is actually happening?
The content of the parent it renders which is what I expect.
The default content of the Child.vue it's evaluated even if it not renders. That's why you see in the console: Cannot read property 'length' of null
Maybe that's not a bug and instead it's the intentional behavior, but it doesn't make sense to me, to evaluate something that will not render.
The text was updated successfully, but these errors were encountered:
posva
changed the title
Default slot content should not be evaluated when the parent replaces it
Default slot content should not be evaluated when the parent is providing it
Jul 3, 2019
I would say this is a bug as we should be able to pass a function to the slot function (_t) so the default slot content is only evaluated if no slot is provided.
I thought a workaround would be using a v-for to make it lazy, but it doesn't work
Version
2.6.10
Reproduction link
https://codesandbox.io/s/kk445knpx3
Steps to reproduce
In the
Child.vue
we have a slot with a default slot content. In theParent.vue
we override the default content of the child.What is expected?
IMO the content of the slot in child component should not be evaluated since the content provided from the parent will be used.
What is actually happening?
The content of the parent it renders which is what I expect.
The default content of the
Child.vue
it's evaluated even if it not renders. That's why you see in the console:Cannot read property 'length' of null
Maybe that's not a bug and instead it's the intentional behavior, but it doesn't make sense to me, to evaluate something that will not render.
The text was updated successfully, but these errors were encountered: