Skip to content

Commit 1fbfa69

Browse files
committed
feat: support specifying allowed keys via generic argument in useTemplateRef()
1 parent f6babf3 commit 1fbfa69

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

packages/runtime-core/src/helpers/useTemplateRef.ts

+2-2
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,8 @@ import { getCurrentInstance } from '../component'
33
import { warn } from '../warning'
44
import { EMPTY_OBJ } from '@vue/shared'
55

6-
export function useTemplateRef<T = unknown>(
7-
key: string,
6+
export function useTemplateRef<T = unknown, Keys extends string = string>(
7+
key: Keys,
88
): Readonly<ShallowRef<T | null>> {
99
const i = getCurrentInstance()
1010
const r = shallowRef(null)

0 commit comments

Comments
 (0)