浏览代码

Explain that `mapActions` supports payloads (#652)

Daniel Diekmeier 8 年之前
父节点
当前提交
9887d718a2
共有 1 个文件被更改,包括 4 次插入1 次删除
  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')