Skip to content

Commit 2c93403

Browse files
committed
feat: add modePicker config
1 parent 3843aa3 commit 2c93403

File tree

2 files changed

+4
-3
lines changed

2 files changed

+4
-3
lines changed

components/Mode/ModePicker.vue

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

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)