From 5cf4d3f9653bb1054294e511842fbff09ee727fa Mon Sep 17 00:00:00 2001 From: Erin Date: Wed, 24 Jul 2019 21:04:10 -0500 Subject: [PATCH] Setting up Nuxt Store --- store/Sidebar.js | 11 +++++++++++ store/index.js | 7 +++++++ 2 files changed, 18 insertions(+) create mode 100644 store/Sidebar.js create mode 100644 store/index.js diff --git a/store/Sidebar.js b/store/Sidebar.js new file mode 100644 index 0000000..16bab35 --- /dev/null +++ b/store/Sidebar.js @@ -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 + } +} \ No newline at end of file diff --git a/store/index.js b/store/index.js new file mode 100644 index 0000000..28de64e --- /dev/null +++ b/store/index.js @@ -0,0 +1,7 @@ +export const state = () => ({ + +}) + +export const mutations = { + +} \ No newline at end of file