From e3ed80a2d9f9ef7077c2a8ea5b7a44e8ed2c55b0 Mon Sep 17 00:00:00 2001 From: lisonge Date: Sat, 23 Mar 2024 22:40:44 +0800 Subject: [PATCH] perf: lazy load TrackGraph --- src/views/SnapshotPage.vue | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/views/SnapshotPage.vue b/src/views/SnapshotPage.vue index 870483b..b5adcb1 100644 --- a/src/views/SnapshotPage.vue +++ b/src/views/SnapshotPage.vue @@ -19,11 +19,13 @@ import { useRoute, useRouter } from 'vue-router'; import { useTitle } from '@vueuse/core'; import { gmOk } from '@/utils/gm'; import { exportSnapshotAsJpgUrl, exportSnapshotAsZipUrl } from '@/utils/export'; -import TrackGraph from '@/components/TrackGraph.vue'; import type { Selector } from '@/utils/selector'; import { NModal, NIcon } from 'naive-ui'; import MultiFocusCard from '@/components/MultiFocusCard.vue'; -import { watch } from 'vue'; +import { watch, defineAsyncComponent } from 'vue'; +const AsyncTrackGraph = defineAsyncComponent( + () => import('@/components/TrackGraph.vue'), +); const route = useRoute(); const router = useRouter(); @@ -193,7 +195,7 @@ watch(
{{ track.selector.toString() }}
- +
*为简化视图已隐藏部分节点