diff --git a/packages/runtime-core/__tests__/apiLifecycle.spec.ts b/packages/runtime-core/__tests__/apiLifecycle.spec.ts index 5da57ab32bf..43054800afe 100644 --- a/packages/runtime-core/__tests__/apiLifecycle.spec.ts +++ b/packages/runtime-core/__tests__/apiLifecycle.spec.ts @@ -40,6 +40,8 @@ describe('api: lifecycle hooks', () => { } render(h(Comp), root) expect(fn).toHaveBeenCalledTimes(1) + // #10863 + expect(fn).toHaveBeenCalledWith() }) it('onMounted', () => { diff --git a/packages/shared/src/general.ts b/packages/shared/src/general.ts index 47e7844851f..1fb33533231 100644 --- a/packages/shared/src/general.ts +++ b/packages/shared/src/general.ts @@ -134,9 +134,9 @@ export const toHandlerKey = cacheStringFunction((str: T) => { export const hasChanged = (value: any, oldValue: any): boolean => !Object.is(value, oldValue) -export const invokeArrayFns = (fns: Function[], arg?: any) => { +export const invokeArrayFns = (fns: Function[], ...arg: any[]) => { for (let i = 0; i < fns.length; i++) { - fns[i](arg) + fns[i](...arg) } }