Skip to content

Instantly share code, notes, and snippets.

@JamieCurnow
Created October 15, 2018 23:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JamieCurnow/c0bfb567dea5eb86bca7a221f7c2505e to your computer and use it in GitHub Desktop.
Save JamieCurnow/c0bfb567dea5eb86bca7a221f7c2505e to your computer and use it in GitHub Desktop.
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