1
1
<template >
2
- <nav v-if =" navbarConfig.length || socialLinks.length || navbarSelectLanguage" class =" navbar-links" >
2
+ <nav
3
+ v-if =" navbarConfig.length || socialLinks.length || navbarSelectLanguage || showToggleDarkModeButton"
4
+ class =" navbar-links"
5
+ >
3
6
<div v-for =" (item, index) in navbarConfig" :key =" index" class =" navbar-links__item" >
4
7
<template v-if =" ' children' in item && item .children " >
5
8
<DropdownLink :item =" item" />
20
23
/>
21
24
22
25
<ToggleDarkModeButton
23
- v-if =" !isMobile && (themeLocal.colorModeSwitch ?? true) "
26
+ v-if =" showToggleDarkModeButton "
24
27
class =" btn--dark-mode navbar-links__item"
25
28
/>
26
29
27
- <ul class =" social-links navbar-links__item" >
30
+ <ul v-if = " socialLinks.length " class =" social-links navbar-links__item" >
28
31
<li
29
32
class =" social-item"
30
33
v-for =" (item, index) in socialLinks"
@@ -42,6 +45,7 @@ import { useSocialLinks } from './useSocialLinks.js'
42
45
import { useNavbarConfig } from ' ./useNavbarConfig.js'
43
46
import { useMobile , useThemeLocaleData } from ' @composables/index.js'
44
47
import { useNavbarSelectLanguage } from ' ./useNavbarSelectLanguage.js'
48
+ import { computed } from ' vue'
45
49
46
50
import Link from ' @components/Link.vue'
47
51
import DropdownLink from ' @components/DropdownLink/index.vue'
@@ -54,4 +58,5 @@ const navbarConfig = useNavbarConfig()
54
58
const themeLocal = useThemeLocaleData ()
55
59
const navbarSelectLanguage = useNavbarSelectLanguage ()
56
60
const { socialLinks, jumpSocialLink } = useSocialLinks ()
61
+ const showToggleDarkModeButton = computed (() => ! isMobile .value && (themeLocal .colorModeSwitch ?? true ))
57
62
</script >
0 commit comments