Skip to content

Commit dab3f39

Browse files
committed
* fix always loading component <Plan> from package pev2 and its css while hydrating before any post type and page is selected @ <QueryPlanVisualizer>
@ fe
1 parent fcf94c3 commit dab3f39

File tree

2 files changed

+6
-4
lines changed

2 files changed

+6
-4
lines changed

fe/src/components/post/QueryPlanVisualizer.vue

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
</select>
1414
</div>
1515
<DefinePlan v-slot="{ query }">
16-
<Plan
16+
<LazyPlan
1717
v-if="query !== undefined" :planQuery="query.query"
1818
:planSource="JSON.stringify(query.plan, null, 4)" class="pev2" />
1919
</DefinePlan>
@@ -28,12 +28,14 @@
2828

2929
<script setup lang="ts">
3030
import type { InfiniteData } from '@tanstack/vue-query';
31-
import { Plan } from 'pev2';
32-
import 'pev2/dist/pev2.css';
3331
3432
const { data } = defineProps<{ data: InfiniteData<ApiPosts['response']> }>();
3533
const selectedPage = ref<Cursor>();
3634
const [DefinePlan, ReusePlan] = createReusableTemplate<{ query?: ApiPosts['response']['query'] }>();
35+
const LazyPlan = defineAsyncComponent(async () => {
36+
await import('pev2/dist/pev2.css');
37+
38+
return (await import('pev2')).Plan;
3739
});
3840
</script>
3941

fe/src/pages/posts.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
<aside class="container">
44
<LazyPostQueryForm :isLoading="isFetching" :queryFormDeps="queryFormDeps" />
55
</aside>
6-
<LazyPostQueryPlanVisualizer v-if="data !== undefined" :data="data" class="border-bottom" />
6+
<PostQueryPlanVisualizer v-if="data !== undefined" :data="data" class="border-bottom" />
77
<aside class="container">
88
<AMenu v-if="!_.isEmpty(data?.pages)" v-model:selectedKeys="selectedRenderTypes" mode="horizontal">
99
<AMenuItem key="list">列表视图</AMenuItem>

0 commit comments

Comments
 (0)