vue keepalive缓存问题

必须同时设置include和exclude,才能实现某些页面缓存,某些页面不缓存。且include、exclude中的名字数组为页面组件中defineOptions({name:''}) name设置的值
<router-view v-slot="{ Component }">
<transition-group>
<keep-alive :include="include" :exclude="exclude">
<component :is="Component" />
</keep-alive>
</transition-group>
</router-view>

posted @ 2024-04-29 20:43  亦茫茫  阅读(7)  评论(0编辑  收藏  举报