Nuxt/examples/vuex-persistedstate/pages/index.vue

27 lines
401 B
Vue
Raw Normal View History

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