repl
repl copied to clipboard
playground hangs indefinitely with keep-alive and missing adjecent v-if combination
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
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.
The repro has an intentional "bad" code. To trigger the playground freeze.
Same code should show errors in regular vue build