Setting up Nuxt Store

This commit is contained in:
Erin
2019-07-24 21:04:10 -05:00
parent 66f84b8f75
commit 5cf4d3f965
2 changed files with 18 additions and 0 deletions

11
store/Sidebar.js Normal file
View File

@@ -0,0 +1,11 @@
export const state = () => ({
cardsShown: true
})
export const mutations = {
toggleCardsShown (state) {
console.log(state.cardsShown)
if (process.browser) localStorage.setItem('cardsShown', !state.cardsShown)
state.cardsShown = !state.cardsShown
}
}

7
store/index.js Normal file
View File

@@ -0,0 +1,7 @@
export const state = () => ({
})
export const mutations = {
}