Skip to content

Commit

Permalink
feat: support specifying allowed keys via generic argument in useTemp…
Browse files Browse the repository at this point in the history
…lateRef()
  • Loading branch information
yyx990803 committed Aug 1, 2024
1 parent f6babf3 commit 1fbfa69
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/runtime-core/src/helpers/useTemplateRef.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 1fbfa69

Please sign in to comment.