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

v-if not patching component scoped slot correctly #12223

Open
decademoon opened this issue Aug 17, 2021 · 2 comments · May be fixed by #12244
Open

v-if not patching component scoped slot correctly #12223

decademoon opened this issue Aug 17, 2021 · 2 comments · May be fixed by #12244

Comments

@decademoon
Copy link
Contributor

decademoon commented Aug 17, 2021

Version

2.6.14

Reproduction link

https://jsfiddle.net/5w1ydeu8/3/

Steps to reproduce

  • Click between A and B => works
  • Click between A and C => works
  • Click between B and C => doesn't work

What is expected?

The scoped slot should update.

What is actually happening?

The scoped slot doesn't update.

@JuniorTour
Copy link
Contributor

JuniorTour commented Aug 17, 2021

Use v-if as a workaround:

  <Foo v-if="frame === 'a'">
    <template #default="x">
      a
    </template>
  </Foo>
  <Foo v-if="frame === 'b'">
    <template #default="x">
      b
    </template>
  </Foo>
  <Foo v-if="frame === 'c'">
    <template #default="x">
      c
    </template>
  </Foo>

But it does have something wrong with v-else-if, I'm looking into it.

@decademoon
Copy link
Contributor Author

decademoon commented Aug 17, 2021

@JuniorTour Thanks, I'm aware of various workarounds (like using key), but I thought this behavior was odd.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants