Skip to content

Commit

Permalink
fix: 🧩 ifram刷新
Browse files Browse the repository at this point in the history
  • Loading branch information
17359898647 committed Sep 22, 2023
1 parent 9160d9e commit 3c35de9
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions src/layout/HKeepAlive/IframKeep.vue
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<script setup lang="ts">
import { toRefs } from '@vueuse/core'
import { forEach, isFunction, isString, some } from 'lodash-es'
import type { Component } from 'vue'
import { inject } from 'vue'
Expand All @@ -13,7 +14,7 @@ const props = defineProps<{
routeName?: RouteRecordName | null
isIframe?: boolean
}>()
const { routeName } = toRefs(props)
const { isRefreshPage, isHeaderHeight, isTagViewHeight, isContentPadding, isFooterHeight } = inject(layoutProvide)!
const { allIframeRouters } = routerHelper()
Expand Down Expand Up @@ -52,10 +53,12 @@ onMounted(()=>{
})
const cacheStore = useKeepAliveCacheStore()
const { exclude } = storeToRefs(cacheStore)
const delayRouteName = refDebounced(routeName!, 500)
function isVif(name?: RouteRecordName | null) {
return props.routeName === name ?
!some(exclude.value, item => item.test(isString(name) ? name : ''))
&& isRefreshPage.value : true
const result = delayRouteName.value === name ?
(!some(exclude.value, item => item.test(isString(name) ? name : '')) && isRefreshPage.value)
: true
return result
}
function isVshow(name?: RouteRecordName | null) {
return props.routeName === name && props.isIframe
Expand Down

0 comments on commit 3c35de9

Please sign in to comment.