Skip to content

Commit c125278

Browse files
committed
[docs] inline actions
1 parent b557526 commit c125278

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

docs/en/actions.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,19 @@ const vm = new Vue({
103103

104104
Now the action will be bound as `vm.plus` instead of `vm.incrementBy`.
105105

106+
If an action is specific to a component, you can take the shortcut and just define it inline:
107+
108+
``` js
109+
const vm = new Vue({
110+
vuex: {
111+
state: { ... },
112+
actions: {
113+
plus: ({ dispatch }) => dispatch('INCREMENT')
114+
}
115+
}
116+
})
117+
```
118+
106119
Finally, if you simply want to bind all the actions:
107120

108121
``` js

0 commit comments

Comments
 (0)