mirror of
https://github.com/doocs/md.git
synced 2024-11-28 13:36:32 +08:00
feature: night mode storage
This commit is contained in:
parent
b60a2abc05
commit
8d822ddbeb
@ -62,6 +62,7 @@ const mutations = {
|
|||||||
},
|
},
|
||||||
themeChanged(state) {
|
themeChanged(state) {
|
||||||
state.nightMode = !state.nightMode;
|
state.nightMode = !state.nightMode;
|
||||||
|
localStorage.setItem('nightMode', state.nightMode)
|
||||||
},
|
},
|
||||||
initEditorState(state) {
|
initEditorState(state) {
|
||||||
state.currentFont = localStorage.getItem('fonts') || config.builtinFonts[0].value
|
state.currentFont = localStorage.getItem('fonts') || config.builtinFonts[0].value
|
||||||
@ -69,6 +70,7 @@ const mutations = {
|
|||||||
state.currentSize = localStorage.getItem('size') || config.sizeOption[2].value
|
state.currentSize = localStorage.getItem('size') || config.sizeOption[2].value
|
||||||
state.codeTheme = localStorage.getItem('codeTheme') || config.codeThemeOption[0].value
|
state.codeTheme = localStorage.getItem('codeTheme') || config.codeThemeOption[0].value
|
||||||
state.citeStatus = localStorage.getItem('citeStatus') === 'true'
|
state.citeStatus = localStorage.getItem('citeStatus') === 'true'
|
||||||
|
state.nightMode = localStorage.getItem('nightMode') || false
|
||||||
state.wxRenderer = new WxRenderer({
|
state.wxRenderer = new WxRenderer({
|
||||||
theme: setColor(state.currentColor),
|
theme: setColor(state.currentColor),
|
||||||
fonts: state.currentFont,
|
fonts: state.currentFont,
|
||||||
|
Loading…
Reference in New Issue
Block a user