Skip to content
This repository was archived by the owner on May 1, 2025. It is now read-only.

Commit 350358b

Browse files
committed
fix: start volar when wc is ready
1 parent 156a8b2 commit 350358b

File tree

3 files changed

+19
-4
lines changed

3 files changed

+19
-4
lines changed

components/PanelDocs.vue

Lines changed: 14 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -56,9 +56,19 @@ const breadcrumbs = computed(() => {
5656
5757
const ui = useUiState()
5858
59-
const sourceUrl = computed(() => page.value?._file
60-
? `https://github.com/nuxt/learn.nuxt.com/edit/main/content/${page.value._file}`
61-
: undefined)
59+
const sourceUrl = computed(() =>
60+
page.value?._file
61+
? `https://github.com/nuxt/learn.nuxt.com/edit/main/content/${page.value._file}`
62+
: undefined,
63+
)
64+
65+
const docsEl = ref<HTMLElement | null>(null)
66+
const router = useRouter()
67+
router.beforeEach(() => {
68+
docsEl.value?.scrollTo({
69+
top: 0,
70+
})
71+
})
6272
</script>
6373

6474
<template>
@@ -82,7 +92,7 @@ const sourceUrl = computed(() => page.value?._file
8292
/>
8393
</div>
8494
<div relative h-full of-hidden>
85-
<article class="max-w-none prose" h-full of-auto p6>
95+
<article ref="docsEl" class="max-w-none prose" h-full of-auto p6>
8696
<ContentDoc />
8797
<div mt8 py2 grid="~ cols-[1fr_1fr] gap-4">
8898
<div>

content/.template/index.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,5 +5,6 @@ export const meta: GuideMeta = {
55
features: {
66
terminal: false,
77
fileTree: false,
8+
navigation: false,
89
},
910
}

monaco/env.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,10 @@ export async function reloadLanguageTools(ctx: PlaygroundMonacoContext) {
8686
const tsconfigRaw = await ctx.webcontainer?.fs
8787
.readFile('.nuxt/tsconfig.json', 'utf-8')
8888
.catch(() => undefined)
89+
90+
if (!tsconfigRaw)
91+
return
92+
8993
const tsconfig = tsconfigRaw
9094
? JSON.parse(stripJsonComments(tsconfigRaw, { trailingCommas: true }))
9195
: {}

0 commit comments

Comments
 (0)