This repository was archived by the owner on May 1, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Expand file tree Collapse file tree 1 file changed +6
-9
lines changed Original file line number Diff line number Diff 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
9693const docsEl = ref <HTMLElement | null >(null )
You can’t perform that action at this time.
0 commit comments