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-show does not work when used on a component that is slotted into a parent component with custom render function #9786

Closed
prashantpalikhe opened this issue Dec 8, 2023 · 2 comments
Labels
🐞 bug Something isn't working scope: ssr

Comments

@prashantpalikhe
Copy link

Vue version

3.3.4

Link to minimal reproduction

https://stackblitz.com/edit/bluwy-create-vite-extra-uaq5oj?file=src%2FApp.vue

Steps to reproduce

The linked StackBlitz has a <Parent /> component that has a custom render function that just renders its default slot.

It then has a <Child /> component that renders a text I should not show.

The App.vue then uses these two components as below:

  <Parent>
    <Child v-show="false" />
  </Parent>

What is expected?

The child component should not be rendered on SSR-rendered HTML. The text I should not show should not be displayed at all in any stage of the page load.

What is actually happening?

There is a flash of text I should not show which is removed when hydration kicks in.

This does not happen when using v-show on a native element instead of a custom component.

System Info

System:
    OS: Linux 5.0 undefined
    CPU: (8) x64 Intel(R) Core(TM) i9-9880H CPU @ 2.30GHz
    Memory: 0 Bytes / 0 Bytes
    Shell: 1.0 - /bin/jsh
  Binaries:
    Node: 18.18.0 - /usr/local/bin/node
    Yarn: 1.22.19 - /usr/local/bin/yarn
    npm: 9.4.2 - /usr/local/bin/npm
    pnpm: 8.10.5 - /usr/local/bin/pnpm
  npmPackages:
    vue: ^3.3.8 => 3.3.11

Any additional comments?

No response

@prashantpalikhe
Copy link
Author

prashantpalikhe commented Dec 8, 2023

Noticed initially when using v-show on a child component of a Nuxt component <NuxtClientFallback /> as reported here

@edison1105 edison1105 added scope: ssr 🐞 bug Something isn't working labels Dec 11, 2023
@edison1105
Copy link
Member

duplicate of #6123

@edison1105 edison1105 closed this as not planned Won't fix, can't repro, duplicate, stale Dec 11, 2023
@github-actions github-actions bot locked and limited conversation to collaborators Dec 26, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🐞 bug Something isn't working scope: ssr
Projects
None yet
Development

No branches or pull requests

2 participants