mirror of
https://gitee.com/dromara/go-view.git
synced 2025-04-06 03:58:04 +08:00
perf: 处理 alive
This commit is contained in:
parent
89d8134fad
commit
7620be2ca5
@ -1,13 +1,9 @@
|
||||
<template>
|
||||
<router-view>
|
||||
<template #default="{ Component, route }">
|
||||
<component
|
||||
v-if="route.meta.noKeepAlive"
|
||||
:is="Component"
|
||||
:key="route.fullPath"
|
||||
></component>
|
||||
<component v-if="route.meta.noKeepAlive" :is="Component"></component>
|
||||
<keep-alive v-else>
|
||||
<component :is="Component" :key="route.meta?.key"></component>
|
||||
<component :is="Component"></component>
|
||||
</keep-alive>
|
||||
</template>
|
||||
</router-view>
|
||||
|
@ -1,14 +1,14 @@
|
||||
<template>
|
||||
<router-view #default="{ Component, route }">
|
||||
<transition name="fade" mode="out-in" appear>
|
||||
<component
|
||||
v-if="route.noKeepAlive"
|
||||
:is="Component"
|
||||
:key="route.fullPath"
|
||||
></component>
|
||||
<keep-alive v-else>
|
||||
<component :is="Component" :key="route.fullPath"></component>
|
||||
</keep-alive>
|
||||
</transition>
|
||||
</router-view>
|
||||
</template>
|
||||
<template>
|
||||
<router-view #default="{ Component, route }">
|
||||
<transition name="fade" mode="out-in" appear>
|
||||
<component
|
||||
v-if="route.meta.noKeepAlive"
|
||||
:is="Component"
|
||||
:key="route.fullPath"
|
||||
></component>
|
||||
<keep-alive v-else>
|
||||
<component :is="Component" :key="route.fullPath"></component>
|
||||
</keep-alive>
|
||||
</transition>
|
||||
</router-view>
|
||||
</template>
|
||||
|
@ -46,11 +46,4 @@ const projectRoutes: RouteRecordRaw = {
|
||||
]
|
||||
}
|
||||
|
||||
projectRoutes.children?.forEach(child => {
|
||||
child.meta = {
|
||||
...child.meta,
|
||||
key: 'reuse-project'
|
||||
}
|
||||
})
|
||||
|
||||
export default projectRoutes
|
||||
|
Loading…
x
Reference in New Issue
Block a user