Merge pull request #13465 from dataease/pr@dev-v2@fix_router
fix(数据大屏、仪表板): 修复预览界面路由切换后首次未刷新页面问题#13362
This commit is contained in:
commit
7daed977a9
@ -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)
|
||||
|
||||
Loading…
Reference in New Issue
Block a user