Skip to content

Commit 1acd004

Browse files
author
anthinkingcoder
committed
修复aoploading otherArg为数组问题
1 parent 109e1a4 commit 1acd004

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

index.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ function aopLoading(commit, loading, fn) {
4141
fn.call(null,
4242
(...arg) => success.apply(null, arg),
4343
(...arg) => error.apply(null, arg),
44-
otherArg)
44+
...otherArg)
4545
}
4646
}
4747

lib/vuex-loading.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ function aopLoading(commit, loading, fn) {
5757
commit(loading, true);
5858
success = pointer(commit, loading, success);
5959
error = pointer(commit, loading, error);
60-
fn.call(null, function () {
60+
fn.call.apply(fn, [null, function () {
6161
for (var _len2 = arguments.length, arg = Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
6262
arg[_key2] = arguments[_key2];
6363
}
@@ -69,7 +69,7 @@ function aopLoading(commit, loading, fn) {
6969
}
7070

7171
return error.apply(null, arg);
72-
}, otherArg);
72+
}].concat(otherArg));
7373
};
7474
}
7575

0 commit comments

Comments
 (0)