mirror of
https://github.com/nuxt/nuxt.git
synced 2024-11-27 08:02:01 +00:00
27 lines
401 B
Vue
27 lines
401 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>
|