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

Commit dc704ba

Browse files
committed
chore
1 parent ea26456 commit dc704ba

File tree

1 file changed

+6
-9
lines changed

1 file changed

+6
-9
lines changed

components/PanelDocs.vue

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ const sourceUrl = computed(() =>
6565
)
6666
6767
// NOTE: remove when hands-on finished (will be held on 2024-10-19)
68-
const THREAD_ID_MAP = {
68+
const THREAD_ID_MAP: Readonly<Record<string, number>> = {
6969
'0.index.md': 85,
7070
'1.vue/1.index.md': 68,
7171
'1.vue/2.reactivity/index.md': 71,
@@ -82,15 +82,12 @@ const THREAD_ID_MAP = {
8282
'2.concepts/7.rendering-modes/index.md': 82,
8383
'2.concepts/8.state-manegement/index.md': 83,
8484
'2.concepts/9.data-fetching/index.md': 84,
85-
} as const satisfies Record<string, number>
86-
87-
type ThreadIdMapKey = keyof typeof THREAD_ID_MAP
85+
}
8886
89-
const threadUrl = computed(() => {
90-
if (page.value?._file) {
91-
const threadId = THREAD_ID_MAP[page.value._file as ThreadIdMapKey]
92-
return `https://github.com/vuejs-jp/learn.nuxt.com/discussions/${threadId}`
93-
}
87+
const threadUrl = computed<string | null>(() => {
88+
return page.value?._file && THREAD_ID_MAP[page.value._file]
89+
? `https://github.com/vuejs-jp/learn.nuxt.com/discussions/${THREAD_ID_MAP[page.value._file]}`
90+
: null
9491
})
9592
9693
const docsEl = ref<HTMLElement | null>(null)

0 commit comments

Comments
 (0)