lession 216: mapActions
This commit is contained in:
parent
096fa93a5c
commit
009f0cfdb3
|
@ -1,13 +1,14 @@
|
|||
<template>
|
||||
<button @click="addOne">Add 1</button>
|
||||
<button @click="increment">Add 1</button>
|
||||
<button @click="increase({ value: 13 })">Add 13</button>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { mapActions } from 'vuex';
|
||||
|
||||
export default {
|
||||
methods: {
|
||||
addOne() {
|
||||
this.$store.dispatch('increment');
|
||||
}
|
||||
...mapActions(['increment', 'increase'])
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
|
Reference in New Issue