lession 216: mapActions
This commit is contained in:
parent
096fa93a5c
commit
009f0cfdb3
|
@ -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>
|
||||||
|
|
Reference in New Issue