vue2 vue3 的keep-alive的用法区别

vue2:
  <template>
  <keep-alive>
     <router-view></router-view>
  </keep-alive>
</template>

vue3:
<template>

<router-view v-slot={Component}>
  <keep-alive>
    <component :is="Component">
  <keep-alive>
</router-view>

</template>

posted @ 2021-12-08 16:33  有肌肉的小眼睛  阅读(452)  评论(0)    收藏  举报