Skip to content

Instantly share code, notes, and snippets.

@M1cr0M1nd
Created May 29, 2019 10:51
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 M1cr0M1nd/a08e9aee5063855e6078cf08b79b1e54 to your computer and use it in GitHub Desktop.
Save M1cr0M1nd/a08e9aee5063855e6078cf08b79b1e54 to your computer and use it in GitHub Desktop.
Intro to the Vue State Manager - Vuex
const store = new Vuex.Store({
state: {
score: 0
}
})
const ScoreDashboard = {
template: `<div>{{ score }}</div>`,
computed: {
score () {
return this.$store.state.score
}
},
mounted () {
this.$store.state.score = 10
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment