Compare commits

...

2 Commits

Author SHA1 Message Date
neverland
2c4b599138
fix(Swipe): failed to render inside keep-alive (#11437) 2022-12-31 10:14:35 +08:00
neverland
670efb16f9
fix(cli): demo keep-alive not work (#11436) 2022-12-31 10:03:44 +08:00
2 changed files with 8 additions and 4 deletions

View File

@ -1,11 +1,11 @@
<template>
<demo-nav />
<router-view v-slot="{ Component }">
<keep-alive>
<demo-section>
<demo-section>
<keep-alive>
<component :is="Component" />
</demo-section>
</keep-alive>
</keep-alive>
</demo-section>
</router-view>
</template>

View File

@ -270,6 +270,10 @@ export default defineComponent({
if (count.value) {
active = Math.min(count.value - 1, active);
if (active === -1) {
active = count.value - 1;
}
}
state.active = active;