1
+ <!-- eslint-disable vue/return-in-computed-property -->
1
2
<script setup lang="ts">
2
3
import type { NavItem , ParsedContent } from ' @nuxt/content'
3
4
@@ -63,6 +64,32 @@ const sourceUrl = computed(() =>
63
64
: undefined ,
64
65
)
65
66
67
+ // NOTE: remove when hands-on finished (will be held on 2024-10-19)
68
+ const THREAD_ID_MAP: Readonly <Record <string , number >> = {
69
+ ' 0.index.md' : 85 ,
70
+ ' 1.vue/1.index.md' : 68 ,
71
+ ' 1.vue/2.reactivity/index.md' : 71 ,
72
+ ' 1.vue/3.reactivity-2/index.md' : 72 ,
73
+ ' 1.vue/4.composition-api/index.md' : 73 ,
74
+ ' 1.vue/5.components/index.md' : 74 ,
75
+ ' 1.vue/6.summary/index.md' : 75 ,
76
+ ' 2.concepts/1.index.md' : 76 ,
77
+ ' 2.concepts/2.app-vue/index.md' : 77 ,
78
+ ' 2.concepts/3.routing/index.md' : 78 ,
79
+ ' 2.concepts/4.auto-imports/index.md' : 79 ,
80
+ ' 2.concepts/5.middleware/index.md' : 80 ,
81
+ ' 2.concepts/6.layout/index.md' : 81 ,
82
+ ' 2.concepts/7.rendering-modes/index.md' : 82 ,
83
+ ' 2.concepts/8.state-manegement/index.md' : 83 ,
84
+ ' 2.concepts/9.data-fetching/index.md' : 84 ,
85
+ }
86
+
87
+ const threadUrl = computed <string | null >(() =>
88
+ 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 ,
91
+ )
92
+
66
93
const docsEl = ref <HTMLElement | null >(null )
67
94
const router = useRouter ()
68
95
router .beforeEach (() => {
@@ -118,7 +145,7 @@ router.beforeEach(() => {
118
145
/>
119
146
</div >
120
147
</div >
121
- <div border =" t base dashed" mt-8 p3 >
148
+ <div flex = " ~ items-center gap-4 " border =" t base dashed" mt-8 p3 >
122
149
<NuxtLink
123
150
v-if =" sourceUrl"
124
151
:to =" sourceUrl" target =" _blank"
@@ -129,6 +156,17 @@ router.beforeEach(() => {
129
156
<div i-ph-note-pencil-duotone />
130
157
Edit this page
131
158
</NuxtLink >
159
+ <NuxtLink
160
+ v-if =" threadUrl"
161
+ :to =" threadUrl"
162
+ target =" _blank"
163
+ flex =" ~ items-center gap-2"
164
+ text-inherit op75
165
+ hover =" text-primary op100"
166
+ >
167
+ <div i-ph-arrow-square-out-fill />
168
+ Ask your question
169
+ </NuxtLink >
132
170
</div >
133
171
</article >
134
172
<!-- Navigration Dropdown -->
0 commit comments