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

First v-if inside a named template causes sibling elements to only render when it itself is rendered #12118

Closed
SarthakSingh31 opened this issue Jun 4, 2021 · 3 comments

Comments

@SarthakSingh31
Copy link

Version

2.6.13

Reproduction link

https://codesandbox.io/s/relaxed-sun-291he?file=/src/App.vue

Steps to reproduce

  1. Create a template with a named slot inside it.
  2. Use this template inside a component.
  3. Put a <div v-if="false"></div> as the first element inside the template for the named slot.
  4. Add a sibling element after the <div v-if="false"></div>.

What is expected?

The sibling element is rendered irrespective of the <div v-if="false"></div> being rendered

What is actually happening?

The sibling element only renders when <div v-if="false"></div> renders i.e. when I set v-if="true"


This is my first time using codesandbox.io so I also created a git repo with the mcve incase the codesandbox.io link does not work.
https://github.com/SarthakSingh31/vue-mcve

@logaretm
Copy link

logaretm commented Jun 5, 2021

Same issue with v-slot syntax for default scoped slots

https://codesandbox.io/s/red-https-vfqxw?file=/src/App.vue

@posva
Copy link
Member

posva commented Jun 5, 2021

Please search existing issues before opening one. Already fixed

@posva posva closed this as completed Jun 5, 2021
@SarthakSingh31
Copy link
Author

I think it will help if #12102 is labeled as a bug as that is the label I searched under when I was looking for an existing issue.

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