fix(图表): 优化移动端跳转问题 (#16898)

This commit is contained in:
王嘉豪 2025-09-04 17:52:54 +08:00 committed by GitHub
parent 6eca8d59b1
commit b1fc6ce8cb
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 16 additions and 1 deletions

View file

@ -339,8 +339,14 @@ const onWrapperClick = e => {
} else {
window.open(url, '_blank')
}
if (inMobile.value) {
window.location.reload()
}
} else {
initOpenHandler(window.open(url, jumpType))
if (inMobile.value) {
window.location.reload()
}
}
} catch (e) {
console.warn('url 格式错误:' + url)

View file

@ -1,6 +1,6 @@
<script setup lang="ts">
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
import { onMounted, reactive } from 'vue'
import { onMounted, onUnmounted, reactive } from 'vue'
import DePreview from '@/components/data-visualization/canvas/DePreview.vue'
import router from '@/router/mobile'
import { initCanvasDataMobile, initCanvasData } from '@/utils/canvasUtils'
@ -152,6 +152,7 @@ onMounted(async () => {
}
dvMainStore.setEmbeddedCallBack(callBackFlag || 'no')
dvMainStore.setPublicLinkStatus(props.publicLinkStatus)
window.addEventListener('popstate', handlePopState)
})
const initBrowserTimer = () => {
@ -164,6 +165,14 @@ const initBrowserTimer = () => {
}
}
const handlePopState = () => {
window.location.reload()
}
onUnmounted(() => {
window.removeEventListener('popstate', handlePopState)
})
defineExpose({
loadCanvasDataAsync
})