Skip to content

Commit 0271eef

Browse files
authored
feat: mark templateRef as deprecated (#4894)
1 parent 2d1797b commit 0271eef

File tree

2 files changed

+8
-0
lines changed

2 files changed

+8
-0
lines changed

‎packages/core/templateRef/index.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,12 @@
22
category: Component
33
---
44

5+
::: info
6+
This function will be removed in future version.
7+
8+
Vue 3.5 introduced the `useTemplateRef` API which can effectively replace the functionality of `templateRef`, therefore we recommend using the native approach.
9+
:::
10+
511
# templateRef
612

713
Shorthand for binding ref to template element.

‎packages/core/templateRef/index.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ import { tryOnMounted } from '@vueuse/shared'
33
import { customRef, getCurrentInstance, onUpdated } from 'vue'
44

55
/**
6+
* @deprecated Use Vue's built-in `useTemplateRef` instead.
7+
*
68
* Shorthand for binding ref to template element.
79
*
810
* @see https://vueuse.org/templateRef

0 commit comments

Comments
 (0)