优化页签的右键刷新问题

This commit is contained in:
神话
2022-05-06 20:04:33 +08:00
parent ce896e105d
commit 464e6e16b0

View File

@@ -30,7 +30,8 @@
v-for="item in hasOpenComponentsArr" v-for="item in hasOpenComponentsArr"
:key="item.name" :key="item.name"
:is="item.name" :is="item.name"
v-show="$route.path === item.path"> v-show="$route.path === item.path"
v-if="reloadIframeFlag">
</component> </component>
</div> </div>
</global-layout> </global-layout>
@@ -66,6 +67,7 @@
{ key: '3', icon: 'close', text: '关闭其它' } { key: '3', icon: 'close', text: '关闭其它' }
], ],
reloadFlag:true, reloadFlag:true,
reloadIframeFlag:true,
componentsArr: [] componentsArr: []
} }
}, },
@@ -300,7 +302,7 @@
this.closeOthers(pageKey) this.closeOthers(pageKey)
break break
case '4': case '4':
this.routeReload() this.routeReload(pageKey)
break break
default: default:
break break
@@ -383,14 +385,22 @@
} }
}, },
//路由刷新 //路由刷新
routeReload(){ routeReload(pageKey){
this.reloadFlag = false if(pageKey.indexOf('/system/plugins')>-1) {
let ToggleMultipage = "ToggleMultipage" //从iframe缓存中关闭对应的页面
this.$store.dispatch(ToggleMultipage,false) this.reloadIframeFlag = false
this.$nextTick(()=>{ this.$nextTick(()=>{
this.$store.dispatch(ToggleMultipage,true) this.reloadIframeFlag = true
this.reloadFlag = true })
}) } else {
this.reloadFlag = false
let ToggleMultipage = "ToggleMultipage"
this.$store.dispatch(ToggleMultipage,false)
this.$nextTick(()=>{
this.$store.dispatch(ToggleMultipage,true)
this.reloadFlag = true
})
}
} }
} }
} }