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(() =>
65
65
)
66
66
67
67
// 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 >> = {
69
69
' 0.index.md' : 85 ,
70
70
' 1.vue/1.index.md' : 68 ,
71
71
' 1.vue/2.reactivity/index.md' : 71 ,
@@ -82,15 +82,12 @@ const THREAD_ID_MAP = {
82
82
' 2.concepts/7.rendering-modes/index.md' : 82 ,
83
83
' 2.concepts/8.state-manegement/index.md' : 83 ,
84
84
' 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
+ }
88
86
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
94
91
})
95
92
96
93
const docsEl = ref <HTMLElement | null >(null )
You can’t perform that action at this time.
0 commit comments