营销:完善装修编辑器重置功能

This commit is contained in:
owen
2023-12-07 16:25:15 +08:00
parent 9128fa98f5
commit eec3a21852
3 changed files with 51 additions and 9 deletions

View File

@ -20,6 +20,17 @@ const getCaches = computed((): string[] => {
})
const tagsView = computed(() => appStore.getTagsView)
//region 无感刷新
const routerAlive = ref(true)
// 无感刷新,防止出现页面闪烁白屏
const reload = () => {
routerAlive.value = false
nextTick(() => (routerAlive.value = true))
}
// 为组件后代提供刷新方法
provide('reload', reload)
//endregion
</script>
<template>
@ -49,7 +60,7 @@ const tagsView = computed(() => appStore.getTagsView)
}
]"
>
<router-view>
<router-view v-if="routerAlive">
<template #default="{ Component, route }">
<keep-alive :include="getCaches">
<component :is="Component" :key="route.fullPath" />