vue3 keep-alive 热更新报错

vue3 keep-alive 热更新报错,我为component加上了key,每次一保存的时候就不行,刷新一下又好了,热更新的问题,怎么解决
代码
<script lang="ts" setup>
import { ref, computed, watch, onUnmounted } from "vue"
// import { computed } from "vue"
import { useStore } from "@/store"
import { useRoute } from "vue-router"
import NavHeader from "@/components/nav-header"
import pageFooter from "@/components/page-footer"
// 缓存组件
const store = useStore()
const include = computed(() => store.state.keepAlive.include)
// 当前name+t
const route = useRoute()

let currentName = ref(route.name as string)
const unwatchRoute = watch(
  () => route.matched,
  () => {
    currentName.value = (route.name as string) || ""
  }
)
onUnmounted(unwatchRoute)
script>
<template>
  <div class="main flex flex-column" id="main">
    <NavHeader />
    <div class="contents flex-1 pageCenter">
      <router-view v-slot="{ Component }">
        <keep-alive :max="10" :include="include">
          <component :is="Component" :key="currentName" />
        keep-alive>
      router-view>
    div>
    <page-footer />
  div>
template>

<style lang="less" scoped>
.main {
  width: 100%;
  height: 100%;
  box-sizing: border-box;
  overflow: hidden;
  overflow-y: auto;
  overflow-y: overlay;
  .pageCenter {
  }
}
style>


错误是这样的: parentComponent.ctx.deactivate is not a function

img

你可以参考下这篇文章:Vue3中的keep-alive路由缓存

看别人也是没有解决