forked from cypress-io/cypress-vue-unit-test
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathCounter.vue
31 lines (30 loc) · 779 Bytes
/
Counter.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
<template>
<div>
Clicked: {{ count }} times, count is {{ evenOrOdd }}.<br>
<button @click="increment">+</button>
<button @click="decrement">-</button>
<button @click="incrementIfOdd">Increment if odd</button>
<button @click="incrementAsync">Increment async</button>
<br><br>
<span>Set Count: </span>
<input type="number" :value="count" @input="set($event.target.value || 0)">
</div>
</template>
<script>
import { mapState, mapGetters, mapMutations, mapActions } from 'vuex'
export default {
computed: {
...mapState(['count']),
...mapGetters(['evenOrOdd'])
},
methods: {
...mapMutations(['set']),
...mapActions([
'increment',
'decrement',
'incrementIfOdd',
'incrementAsync'
])
}
}
</script>