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

playground hangs indefinitely with keep-alive and missing adjecent v-if combination #26

Open
lidlanca opened this issue Mar 20, 2022 · 2 comments

Comments

@lidlanca
Copy link

replace template with this code in the sfc playground.

<template>
  <keep-alive>
    <A  v-if="1" ></A>
    break
    <A v-else></A>
  </keep-alive>    
</template>

this combination should trigger 2 errors
Vue template compilation error: <KeepAlive> expects exactly one child component.(45)
Vue template compilation error: v-else/v-else-if has no adjacent v-if or v-else-if.(30)

but instead it causes infinite loop

severity: annoyance, edge case

@linpeng118
Copy link

Hello,
First of all this is the place to solve the problem of @vue/repl, your problem is not about repl. Then you're not familiar with keep-alive.
the right way:
<keep-alive include="a,b"> <component :is="view"></component> </keep-alive> or <keep-alive> <router-view v-if="$route.meta.keepAlive"></router-view> </keep-alive>
Thanks.

@lidlanca
Copy link
Author

The repro has an intentional "bad" code.
To trigger the playground freeze.

Same code should show errors in regular vue build

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

2 participants