Nuxt/examples/vuex-persistedstate/pages/index.vue
2017-08-22 13:24:23 +02:00

23 lines
369 B
Vue

<template>
<div>
<p>{{ counter }}</p>
<p>
<button @click="increment">+</button>
<button @click="decrement">-</button>
</p>
</div>
</template>
<script>
import { mapState, mapMutations } from 'vuex'
export default {
computed: {
...mapState(['counter'])
},
methods: {
...mapMutations(['increment', 'decrement'])
}
}
</script>