mirror of
https://github.com/un-pany/v3-admin-vite.git
synced 2025-04-21 11:29:20 +08:00
fix: 应该在组件销毁前移除路由变化事件监听器
This commit is contained in:
parent
086e9a8c60
commit
5113d60565
@ -1,5 +1,5 @@
|
||||
<script lang="ts" setup>
|
||||
import { getCurrentInstance, onMounted, onUnmounted, ref, watch } from "vue"
|
||||
import { getCurrentInstance, onBeforeUnmount, onMounted, ref, watch } from "vue"
|
||||
import { type RouteLocationNormalizedLoaded, type RouteRecordRaw, RouterLink, useRoute, useRouter } from "vue-router"
|
||||
import { type TagView, useTagsViewStore } from "@/store/modules/tags-view"
|
||||
import { usePermissionStore } from "@/store/modules/permission"
|
||||
@ -161,7 +161,7 @@ onMounted(() => {
|
||||
addTags(route)
|
||||
})
|
||||
|
||||
onUnmounted(() => {
|
||||
onBeforeUnmount(() => {
|
||||
removeRouteListener()
|
||||
})
|
||||
</script>
|
||||
|
Loading…
x
Reference in New Issue
Block a user