Skip to content

Commit 9e88b96

Browse files
committed
feat: add modePicker config (again)
1 parent 206fb17 commit 9e88b96

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

packages/vuepress-theme-reco/components/Mode/ModePicker.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,9 @@ export default {
3030
3131
mounted () {
3232
const mode = localStorage.getItem('mode')
33-
const { mode: customizeMode } = this.$themeConfig
34-
this.currentMode = mode ?? customizeMode ?? 'auto'
33+
const { mode: customMode, modePicker } = this.$themeConfig
34+
const themeMode = customMode ?? 'auto'
35+
this.currentMode = modePicker === false ? themeMode : mode ?? themeMode
3536
setMode(this.currentMode)
3637
},
3738

packages/vuepress-theme-reco/components/Navbar.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@
2222
'max-width': linksWrapMaxWidth + 'px'
2323
} : {}">
2424

25-
<Mode v-show="$themeConfig.mode !== null" />
25+
<Mode v-show="$themeConfig.modePicker !== false" />
2626
<AlgoliaSearchBox
2727
v-if="isAlgoliaSearch"
2828
:options="algolia"/>

0 commit comments

Comments
 (0)