15.07 Make the Settings Persistent using LocalStorage Plugin
This commit is contained in:
parent
92a7f0df0d
commit
7443c2cf6a
@ -100,7 +100,8 @@ module.exports = function (/* ctx */) {
|
|||||||
|
|
||||||
// Quasar plugins
|
// Quasar plugins
|
||||||
plugins: [
|
plugins: [
|
||||||
'Dialog'
|
'Dialog',
|
||||||
|
'LocalStorage'
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -1,3 +1,5 @@
|
|||||||
|
import { LocalStorage } from 'quasar'
|
||||||
|
|
||||||
const state = {
|
const state = {
|
||||||
settings: {
|
settings: {
|
||||||
show12HourTimeFormat: false,
|
show12HourTimeFormat: false,
|
||||||
@ -15,11 +17,16 @@ const mutations = {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const actions = {
|
const actions = {
|
||||||
setShow12HourTimeFormat ({ commit }, value) {
|
setShow12HourTimeFormat ({ commit, dispatch }, value) {
|
||||||
commit('setShow12HourTimeFormat', value)
|
commit('setShow12HourTimeFormat', value)
|
||||||
|
dispatch('saveSettings')
|
||||||
},
|
},
|
||||||
setShowTasksInOnelist ({ commit }, value) {
|
setShowTasksInOnelist ({ commit, dispatch }, value) {
|
||||||
commit('setShowTasksInOnelist', value)
|
commit('setShowTasksInOnelist', value)
|
||||||
|
dispatch('saveSettings')
|
||||||
|
},
|
||||||
|
saveSettings ({ state }) {
|
||||||
|
LocalStorage.set('settings', state.settings)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user