关闭融合页面关闭历史记录页面

uat_us
caiyiling 2024-03-29 12:56:00 +08:00
parent 12db782153
commit 7b475b4873
1 changed files with 8 additions and 0 deletions

View File

@ -629,8 +629,15 @@ export default {
const routeData = this.$router.resolve({ path }) const routeData = this.$router.resolve({ path })
this.screenshotWindow = window.open(routeData.href, '_blank') this.screenshotWindow = window.open(routeData.href, '_blank')
}) })
window.addEventListener("beforeunload",() => {
if (this.screenshotWindow) {
this.screenshotWindow.close()
}
})
}, },
beforeDestroy() { beforeDestroy() {
console.log('beforeDestroy',this.screenshotWindow)
if (this.screenshotWindow) { if (this.screenshotWindow) {
this.screenshotWindow.close() this.screenshotWindow.close()
} }
@ -645,6 +652,7 @@ export default {
FusionEvent.$off('removeAnnotation') FusionEvent.$off('removeAnnotation')
FusionEvent.$off('imageLocation') FusionEvent.$off('imageLocation')
FusionEvent.$off('getScreenshots') FusionEvent.$off('getScreenshots')
window.removeEventListener("beforeunload")
}, },
methods: { methods: {