1
0
mirror of https://github.com/zclzone/vue-naive-admin.git synced 2025-12-28 20:10:22 +08:00

feat: 集成重新加载页面功能

This commit is contained in:
张传龙
2022-04-21 22:35:26 +08:00
parent 585bf4a4c4
commit 3c46d2c159
4 changed files with 43 additions and 8 deletions

View File

@@ -1,7 +1,7 @@
<template>
<router-view v-slot="{ Component, route }">
<transition name="fade-slide" mode="out-in" appear>
<div :key="route.path">
<div v-if="appStore.reloadFlag" :key="route.path">
<keep-alive :include="keepAliveRouteNames">
<component :is="Component" />
</keep-alive>
@@ -13,6 +13,9 @@
<script setup>
import { computed } from 'vue'
import { useRouter } from 'vue-router'
import { useAppStore } from '@/store/modules/app'
const appStore = useAppStore()
const router = useRouter()
const allRoutes = router.getRoutes()
const keepAliveRouteNames = computed(() => {