|
@@ -373,14 +373,14 @@ function makeLocalGetters (store, namespace) {
|
|
function registerMutation (store, type, handler, local) {
|
|
function registerMutation (store, type, handler, local) {
|
|
const entry = store._mutations[type] || (store._mutations[type] = [])
|
|
const entry = store._mutations[type] || (store._mutations[type] = [])
|
|
entry.push(function wrappedMutationHandler (payload) {
|
|
entry.push(function wrappedMutationHandler (payload) {
|
|
- handler(local.state, payload)
|
|
|
|
|
|
+ handler.call(store, local.state, payload)
|
|
})
|
|
})
|
|
}
|
|
}
|
|
|
|
|
|
function registerAction (store, type, handler, local) {
|
|
function registerAction (store, type, handler, local) {
|
|
const entry = store._actions[type] || (store._actions[type] = [])
|
|
const entry = store._actions[type] || (store._actions[type] = [])
|
|
entry.push(function wrappedActionHandler (payload, cb) {
|
|
entry.push(function wrappedActionHandler (payload, cb) {
|
|
- let res = handler({
|
|
|
|
|
|
+ let res = handler.call(store, {
|
|
dispatch: local.dispatch,
|
|
dispatch: local.dispatch,
|
|
commit: local.commit,
|
|
commit: local.commit,
|
|
getters: local.getters,
|
|
getters: local.getters,
|