diff --git a/packages/runtime-core/__tests__/apiTemplateRef.spec.ts b/packages/runtime-core/__tests__/apiTemplateRef.spec.ts index d164d457..f9b6b1b5 100644 --- a/packages/runtime-core/__tests__/apiTemplateRef.spec.ts +++ b/packages/runtime-core/__tests__/apiTemplateRef.spec.ts @@ -4,7 +4,6 @@ import { h, render, nextTick, - Ref, createComponent } from '@vue/runtime-test' @@ -142,7 +141,7 @@ describe('api: template refs', () => { foo: ref(null), bar: ref(null) } - const refKey: Ref<keyof typeof refs> = ref('foo') + const refKey = ref<keyof typeof refs>('foo') const Comp = { setup() { diff --git a/packages/runtime-core/src/apiWatch.ts b/packages/runtime-core/src/apiWatch.ts index efd3dfd4..a3fd6acf 100644 --- a/packages/runtime-core/src/apiWatch.ts +++ b/packages/runtime-core/src/apiWatch.ts @@ -72,7 +72,10 @@ export function watch<T>( // Readonly constraint helps the callback to correctly infer value types based // on position in the source array. Otherwise the values will get a union type // of all possible value types. -export function watch<T extends Readonly<WatcherSource<unknown>[]>>( +export function watch< + T extends Readonly<WatcherSource<TArgs>>, + TArgs extends Array<any> = any[] +>( sources: T, cb: WatchHandler<MapSources<T>>, options?: WatchOptions