lession 216: mapActions

This commit is contained in:
Andreas Zweili 2021-05-04 23:00:27 +02:00
parent 096fa93a5c
commit 009f0cfdb3
1 changed files with 5 additions and 4 deletions

View File

@ -1,13 +1,14 @@
<template> <template>
<button @click="addOne">Add 1</button> <button @click="increment">Add 1</button>
<button @click="increase({ value: 13 })">Add 13</button>
</template> </template>
<script> <script>
import { mapActions } from 'vuex';
export default { export default {
methods: { methods: {
addOne() { ...mapActions(['increment', 'increase'])
this.$store.dispatch('increment');
}
} }
}; };
</script> </script>