Merge pull request #13465 from dataease/pr@dev-v2@fix_router

fix(数据大屏、仪表板): 修复预览界面路由切换后首次未刷新页面问题#13362
This commit is contained in:
王嘉豪 2024-11-21 15:59:30 +08:00 committed by GitHub
commit 7daed977a9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1,6 +1,6 @@
<script setup lang="ts">
import { dvMainStoreWithOut } from '@/store/modules/data-visualization/dvMain'
import { nextTick, onMounted, reactive, ref } from 'vue'
import { nextTick, onMounted, reactive, ref, watch } from 'vue'
import DePreview from '@/components/data-visualization/canvas/DePreview.vue'
import router from '@/router'
import { useEmitt } from '@/hooks/web/useEmitt'
@ -16,6 +16,8 @@ import { propTypes } from '@/utils/propTypes'
import { downloadCanvas2 } from '@/utils/imgUtils'
import { setTitle } from '@/utils/utils'
import EmptyBackground from '../../components/empty-background/src/EmptyBackground.vue'
import { useRoute } from 'vue-router'
const routeWatch = useRoute()
const dvMainStore = dvMainStoreWithOut()
const { t } = useI18n()
@ -151,6 +153,15 @@ const downloadH2 = type => {
})
})
}
//
//
watch(
() => ({ path: routeWatch.path, params: routeWatch.params }),
() => {
location.reload() //
},
{ deep: true }
)
let p = null
const XpackLoaded = () => p(true)