Created
October 15, 2018 23:53
-
-
Save JamieCurnow/c0bfb567dea5eb86bca7a221f7c2505e to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const state = { | |
// this toggles the sidedrawer | |
sideDrawer: false | |
} | |
const mutations = { | |
// always and only change vuex state through mutations. | |
setSideDrawer (state, data) { | |
state.sideDrawer = data | |
} | |
} | |
const getters = { | |
// the 'sideDrawer' getter will be available to listen to on the front end. | |
// this is the change that we're watching in /app/mixins/sideDrawer.js | |
sideDrawer: (state) => state.sideDrawer | |
} | |
// export this module. | |
export default { | |
state, | |
mutations, | |
getters | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment