fix(仪表板): 修复浏览器整体刷新移动端未生效问题

This commit is contained in:
wangjiahao 2024-09-13 16:26:14 +08:00
parent d5a180c20c
commit ae4dc7e0cf

View File

@ -119,6 +119,7 @@ const loadCanvasDataAsync = async (dvId, dvType) => {
document.title = dvInfo.name
setTitle(dvInfo.name)
}
initBrowserTimer()
}
)
}
@ -139,6 +140,16 @@ onMounted(async () => {
dvMainStore.setPublicLinkStatus(props.publicLinkStatus)
})
const initBrowserTimer = () => {
if (state.canvasStylePreview.refreshBrowserEnable) {
const gap = state.canvasStylePreview.refreshBrowserUnit === 'minute' ? 60 : 1
const browserRefreshTime = state.canvasStylePreview.refreshBrowserTime * gap * 1000
setTimeout(() => {
window.location.reload()
}, browserRefreshTime)
}
}
defineExpose({
loadCanvasDataAsync
})