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>
|
<template>
|
||||||
<router-view>
|
<router-view>
|
||||||
<template #default="{ Component, route }">
|
<template #default="{ Component, route }">
|
||||||
<component
|
<component v-if="route.meta.noKeepAlive" :is="Component"></component>
|
||||||
v-if="route.meta.noKeepAlive"
|
|
||||||
:is="Component"
|
|
||||||
:key="route.fullPath"
|
|
||||||
></component>
|
|
||||||
<keep-alive v-else>
|
<keep-alive v-else>
|
||||||
<component :is="Component" :key="route.meta?.key"></component>
|
<component :is="Component"></component>
|
||||||
</keep-alive>
|
</keep-alive>
|
||||||
</template>
|
</template>
|
||||||
</router-view>
|
</router-view>
|
||||||
|
@ -1,14 +1,14 @@
|
|||||||
<template>
|
<template>
|
||||||
<router-view #default="{ Component, route }">
|
<router-view #default="{ Component, route }">
|
||||||
<transition name="fade" mode="out-in" appear>
|
<transition name="fade" mode="out-in" appear>
|
||||||
<component
|
<component
|
||||||
v-if="route.noKeepAlive"
|
v-if="route.meta.noKeepAlive"
|
||||||
:is="Component"
|
:is="Component"
|
||||||
:key="route.fullPath"
|
:key="route.fullPath"
|
||||||
></component>
|
></component>
|
||||||
<keep-alive v-else>
|
<keep-alive v-else>
|
||||||
<component :is="Component" :key="route.fullPath"></component>
|
<component :is="Component" :key="route.fullPath"></component>
|
||||||
</keep-alive>
|
</keep-alive>
|
||||||
</transition>
|
</transition>
|
||||||
</router-view>
|
</router-view>
|
||||||
</template>
|
</template>
|
||||||
|
@ -46,11 +46,4 @@ const projectRoutes: RouteRecordRaw = {
|
|||||||
]
|
]
|
||||||
}
|
}
|
||||||
|
|
||||||
projectRoutes.children?.forEach(child => {
|
|
||||||
child.meta = {
|
|
||||||
...child.meta,
|
|
||||||
key: 'reuse-project'
|
|
||||||
}
|
|
||||||
})
|
|
||||||
|
|
||||||
export default projectRoutes
|
export default projectRoutes
|
||||||
|
Loading…
x
Reference in New Issue
Block a user