Skip to content

Instantly share code, notes, and snippets.

@meshboy
Created September 13, 2018 02:14
Show Gist options
  • Save meshboy/cf8d04994682605006cc5a9b6aab6d4b to your computer and use it in GitHub Desktop.
Save meshboy/cf8d04994682605006cc5a9b6aab6d4b to your computer and use it in GitHub Desktop.
<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