Created
September 13, 2018 02:14
-
-
Save meshboy/cf8d04994682605006cc5a9b6aab6d4b 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
<template> | |
<div> | |
<button class="btn btn-primary" @click="increase">Increase</button> | |
<button class="btn btn-danger" @click="decrease">Decrease</button> | |
</div> | |
</template> | |
<script> | |
export default { | |
name: "app-counter", | |
methods: { | |
// increase() { | |
// this.$store.state.counter++; | |
// }, | |
// decrease() { | |
// this.$store.state.counter--; | |
// } | |
increase() { | |
this.$store.commit('increase'); | |
}, | |
decrease() { | |
this.$store.commit('decrement'); | |
} | |
} | |
}; | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment