File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -246,16 +246,18 @@ const canonicalUrl = computed(() => {
246246// Toggle markdown view mode
247247const markdownViewModes = [
248248 {
249+ key: ' preview' ,
249250 label: $t (' code.markdown_view_mode.preview' ),
250251 icon: ' i-carbon-view' ,
251252 },
252253 {
254+ key: ' code' ,
253255 label: $t (' code.markdown_view_mode.code' ),
254256 icon: ' i-carbon-code' ,
255257 },
256258] as const
257259
258- const markdownViewMode = ref <(typeof markdownViewModes )[number ][' label ' ]>(' preview' )
260+ const markdownViewMode = ref <(typeof markdownViewModes )[number ][' key ' ]>(' preview' )
259261
260262useHead ({
261263 link: [{ rel: ' canonical' , href: canonicalUrl }],
@@ -384,14 +386,14 @@ useSeoMeta({
384386 >
385387 <button
386388 v-for =" mode in markdownViewModes"
387- :key =" mode.label "
389+ :key =" mode.key "
388390 class =" px-2 py-1.5 font-mono text-xs rounded transition-colors duration-150 border border-solid focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-fg/50 inline-flex items-center gap-1.5"
389391 :class ="
390- markdownViewMode === mode.label
392+ markdownViewMode === mode.key
391393 ? 'bg-bg shadow text-fg border-border'
392394 : 'text-fg-subtle hover:text-fg border-transparent'
393395 "
394- @click =" markdownViewMode = mode.label "
396+ @click =" markdownViewMode = mode.key "
395397 >
396398 <span class =" inline-block h-3 w-3" :class =" mode.icon" aria-hidden =" true" />
397399 {{ mode.label }}
You can’t perform that action at this time.
0 commit comments