-
-
Save M1cr0M1nd/a08e9aee5063855e6078cf08b79b1e54 to your computer and use it in GitHub Desktop.
Intro to the Vue State Manager - Vuex
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 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