Quellcode durchsuchen

Explain that `mapActions` supports payloads (#652)

Daniel Diekmeier vor 8 Jahren
Ursprung
Commit
9887d718a2
1 geänderte Dateien mit 4 neuen und 1 gelöschten Zeilen
  1. 4 1
      docs/en/actions.md

+ 4 - 1
docs/en/actions.md

@@ -107,7 +107,10 @@ export default {
   // ...
   methods: {
     ...mapActions([
-      'increment' // map this.increment() to this.$store.dispatch('increment')
+      'increment', // map this.increment() to this.$store.dispatch('increment')
+      
+      // mapActions also supports payloads:
+      'incrementBy' // this.incrementBy(amount) maps to this.$store.dispatch('incrementBy', amount)
     ]),
     ...mapActions({
       add: 'increment' // map this.add() to this.$store.dispatch('increment')