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

Repeated v-if change causes slot to disappear #1708

Closed
gitFoxCode opened this issue Nov 24, 2022 · 0 comments · Fixed by #1734
Closed

Repeated v-if change causes slot to disappear #1708

gitFoxCode opened this issue Nov 24, 2022 · 0 comments · Fixed by #1734

Comments

@gitFoxCode
Copy link

gitFoxCode commented Nov 24, 2022

Environment


  • Operating System: Linux
  • Node Version: v16.12.0
  • Nuxt Version: 3.0.0-rc.11
  • Nitro Version: 0.5.4
  • Package Manager: yarn@1.22.19
  • Builder: vite
  • User Config: alias, content, nitro, modules, extends, github, colorMode, runtimeConfig
  • Runtime Modules: @nuxtjs/algolia@1.1.4
  • Build Modules: -

Reproduction

  1. Create index.md file
  2. Create components/content/Something.vue
  3. Run app, while:

index.md:

::something
#truevar
This is true! Hello!
#falsevar
This is false! :(

Something.vue:

<template>
    <div v-if="test">
        <slot name="truevar"></slot>
    </div>
    <div v-if="!test">
        <slot name="falsevar"></slot>
    </div> 
</template>

<script setup>
const test = ref(true)

setInterval(()=>{
    test.value = !test.value
}, 1000)
</script>

In the real world, of course, I use useState instead of setInterval, but the action is the same.

Describe the bug

When there is a component in a file, e.g. .md, which has component with a v-if and this v-if changes its state frequently then <slot> disappears.

Additional context

No response

Logs

No response

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

Successfully merging a pull request may close this issue.

1 participant