原来是这样的,没有问题:
<router-view>
<template #default="{ Component, route }">
<keep-alive :include="getCaches">
<component :is="Component" :key="route.fullPath" />
</keep-alive>
</template>
</router-view>
我改成下面这样了,keep-alive竟然不管用了
<router-view>
<template #default="{ Component, route }">
<keep-alive :include="getCaches">
<div class="animate__animated animate__fadeIn" :key="route.fullPath" >
<component :is="Component"/>
</div>
</keep-alive>
</template>
</router-view>
有解决方法吗?
这样写就可以了