fix(editor): 由于有可选参数,所以将after hook的返回值放到第一个参数

This commit is contained in:
roymondchen 2022-04-21 20:42:47 +08:00 committed by jia000
parent 8e004f9766
commit 9526c44d16

View File

@ -53,7 +53,7 @@ const doAction = async (
let returnValue: any = await fn(beforeArgs, sourceMethod.bind(scope));
for (const afterMethod of scope.pluginOptionsList[afterMethodName]) {
returnValue = await afterMethod(...beforeArgs, returnValue);
returnValue = await afterMethod(returnValue, ...beforeArgs);
if (isError(returnValue)) throw returnValue;
}