Skip to content

Commit 5f6b534

Browse files
ba0708yyx990803
authored andcommitted
Added example of passing payload to mutation with mapMutations helper (#734)
1 parent 92d177b commit 5f6b534

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

docs/en/mutations.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,10 @@ export default {
146146
// ...
147147
methods: {
148148
...mapMutations([
149-
'increment' // map this.increment() to this.$store.commit('increment')
149+
'increment', // map this.increment() to this.$store.commit('increment')
150+
151+
// mapMutations also supports payloads:
152+
'incrementBy' // this.incrementBy(amount) maps to this.$store.commit('incrementBy', amount)
150153
]),
151154
...mapMutations({
152155
add: 'increment' // map this.add() to this.$store.commit('increment')

0 commit comments

Comments
 (0)