File tree Expand file tree Collapse file tree 2 files changed +30
-31
lines changed Expand file tree Collapse file tree 2 files changed +30
-31
lines changed Original file line number Diff line number Diff line change @@ -8,14 +8,15 @@ useHead({
8
8
9
9
const color = useColorMode ()
10
10
const mode = computed (() => color .value as ConfigProviderTheme )
11
-
12
11
</script >
13
12
14
13
<template >
15
14
<VanConfigProvider :theme =" mode" >
16
- <NuxtLayout >
17
- <NuxtPage />
18
- </NuxtLayout >
15
+ <ColorScheme tag =" div" >
16
+ <NuxtLayout >
17
+ <NuxtPage />
18
+ </NuxtLayout >
19
+ </ColorScheme >
19
20
</VanConfigProvider >
20
21
</template >
21
22
Original file line number Diff line number Diff line change @@ -30,33 +30,31 @@ function toggleDark() {
30
30
</script >
31
31
32
32
<template >
33
- <ClientOnly >
34
- <VanCellGroup inset >
35
- <VanCell
36
- center
37
- title =" 🌗 暗黑模式"
38
- >
39
- <template #right-icon >
40
- <VanSwitch
41
- v-model =" checked"
42
- size =" 20px"
43
- aria-label =" on/off Dark Mode"
44
- @click =" toggleDark"
45
- />
46
- </template >
47
- </VanCell >
48
-
49
- <template
50
- v-for =" item in menuItems "
51
- :key =" item .route "
52
- >
53
- <!-- item.route -->
54
- <VanCell
55
- :title =" item.title"
56
- to =" /"
57
- is-link
33
+ <VanCellGroup inset >
34
+ <VanCell
35
+ center
36
+ title =" 🌗 暗黑模式"
37
+ >
38
+ <template #right-icon >
39
+ <VanSwitch
40
+ v-model =" checked"
41
+ size =" 20px"
42
+ aria-label =" on/off Dark Mode"
43
+ @click =" toggleDark"
58
44
/>
59
45
</template >
60
- </VanCellGroup >
61
- </ClientOnly >
46
+ </VanCell >
47
+
48
+ <template
49
+ v-for =" item in menuItems "
50
+ :key =" item .route "
51
+ >
52
+ <!-- item.route -->
53
+ <VanCell
54
+ :title =" item.title"
55
+ to =" /"
56
+ is-link
57
+ />
58
+ </template >
59
+ </VanCellGroup >
62
60
</template >
You can’t perform that action at this time.
0 commit comments