mirror of https://github.com/vuejs/core.git
feat: support specifying allowed keys via generic argument in useTemplateRef()
This commit is contained in:
parent
f6babf3236
commit
1fbfa6962b
|
@ -3,8 +3,8 @@ import { getCurrentInstance } from '../component'
|
|||
import { warn } from '../warning'
|
||||
import { EMPTY_OBJ } from '@vue/shared'
|
||||
|
||||
export function useTemplateRef<T = unknown>(
|
||||
key: string,
|
||||
export function useTemplateRef<T = unknown, Keys extends string = string>(
|
||||
key: Keys,
|
||||
): Readonly<ShallowRef<T | null>> {
|
||||
const i = getCurrentInstance()
|
||||
const r = shallowRef(null)
|
||||
|
|
Loading…
Reference in New Issue