Skip to content

Commit

Permalink
chore
Browse files Browse the repository at this point in the history
  • Loading branch information
ubugeeei committed Oct 11, 2024
1 parent ea26456 commit 56ee733
Showing 1 changed file with 7 additions and 10 deletions.
17 changes: 7 additions & 10 deletions components/PanelDocs.vue
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ const sourceUrl = computed(() =>
)
// NOTE: remove when hands-on finished (will be held on 2024-10-19)
const THREAD_ID_MAP = {
const THREAD_ID_MAP: Readonly<Record<string, number>> = {
'0.index.md': 85,
'1.vue/1.index.md': 68,
'1.vue/2.reactivity/index.md': 71,
Expand All @@ -82,16 +82,13 @@ const THREAD_ID_MAP = {
'2.concepts/7.rendering-modes/index.md': 82,
'2.concepts/8.state-manegement/index.md': 83,
'2.concepts/9.data-fetching/index.md': 84,
} as const satisfies Record<string, number>
type ThreadIdMapKey = keyof typeof THREAD_ID_MAP
}
const threadUrl = computed(() => {
if (page.value?._file) {
const threadId = THREAD_ID_MAP[page.value._file as ThreadIdMapKey]
return `https://github.com/vuejs-jp/learn.nuxt.com/discussions/${threadId}`
}
})
const threadUrl = computed<string | null>(() =>
page.value?._file && THREAD_ID_MAP[page.value._file]
? `https://github.com/vuejs-jp/learn.nuxt.com/discussions/${THREAD_ID_MAP[page.value._file]}`
: null,
)
const docsEl = ref<HTMLElement | null>(null)
const router = useRouter()
Expand Down

0 comments on commit 56ee733

Please sign in to comment.