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

Unexpected v-if behaviour in slot/template #12107

Closed
mrkwdwrd opened this issue Jun 3, 2021 · 3 comments
Closed

Unexpected v-if behaviour in slot/template #12107

mrkwdwrd opened this issue Jun 3, 2021 · 3 comments

Comments

@mrkwdwrd
Copy link

mrkwdwrd commented Jun 3, 2021

Version

2.6.13

Reproduction link

https://codepen.io/mrkwdwrd/pen/YzZedOe

Steps to reproduce

Use the button to toggle the value of 'foo'.

What is expected?

The elements in the 'content' slot with the v-if directive should display based on whether the value of 'foo' is true/false.

The elements with no v-if directive should display regardless of the value of 'foo'.

What is actually happening?

When the elements are direct children of the slot template, neither are visible when 'foo' is false, both are visible when 'foo' is false if the element with the v-if directive is the first.

If the element without the v-if directive is the first, it is always displayed while the the the element with the v-if directive displays according to the value of 'foo'.

When the elements are wrapped and not direct children of the slot template, the element with the v-if directive displays according to the value of 'foo'. The element with no v-if directive always displays.


The behaviour was as expected before upgrading to vue@2.6.13. Rolled back to vue@2.6.11 and the expected behaviour was restored.

@doooooit
Copy link

doooooit commented Jun 3, 2021

I have the same problem

@mrkwdwrd
Copy link
Author

mrkwdwrd commented Jun 3, 2021

Issue also not present on v2.6.12 - though there's no release notes for this version

@posva
Copy link
Member

posva commented Jun 3, 2021

Already fixed. Search existing issues first, please

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

No branches or pull requests

3 participants