Skip to content

Commit acce3bb

Browse files
authored
feat(templateRef): support specifying allowed keys via generic argument (#4162)
1 parent 1c849e2 commit acce3bb

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/core/templateRef/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,8 @@ import { tryOnMounted } from '@vueuse/shared'
99
* @param key
1010
* @param initialValue
1111
*/
12-
export function templateRef<T extends HTMLElement | SVGElement | Component | null>(
13-
key: string,
12+
export function templateRef<T extends HTMLElement | SVGElement | Component | null, Keys extends string = string>(
13+
key: Keys,
1414
initialValue: T | null = null,
1515
): Readonly<Ref<T>> {
1616
const instance = getCurrentInstance()

0 commit comments

Comments
 (0)