Skip to content

Commit 7f2a355

Browse files
committed
perf: defineAsyncComponent TrackGraph
1 parent a4b4fc2 commit 7f2a355

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

src/components/TrackCard.vue

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,13 @@
1+
<script lang="ts">
2+
const TrackGraphLoader = () => import('@/components/TrackGraph.vue');
3+
const TrackGraph = defineAsyncComponent({
4+
loader: TrackGraphLoader,
5+
delay: 0,
6+
});
7+
setTimeout(TrackGraphLoader, 3000);
8+
</script>
19
<script setup lang="ts">
210
import SelectorText from '@/components/SelectorText.vue';
3-
import TrackTreeGraph from '@/components/TrackGraph.vue';
411
import { buildEmptyFn, colorList } from '@/utils/others';
512
import { type ResolvedSelector } from '@/utils/selector';
613
import type { RawNode } from '@/utils/types';
@@ -83,7 +90,7 @@ const getNodeStyle = (node: AstNode<any>): StyleValue => {
8390
</div>
8491
<div flex-1 flex gap-12px overflow-hidden>
8592
<div self-stretch flex="[2]">
86-
<TrackTreeGraph
93+
<TrackGraph
8794
v-if="nodes.length && queryResult"
8895
:nodes="nodes"
8996
:queryResult="queryResult"

0 commit comments

Comments
 (0)