vuejs / eslint-plugin-vue

Official ESLint plugin for Vue.js
https://eslint.vuejs.org/
MIT License
4.47k stars 667 forks source link

feat(no-unused-refs): support template ref api #2541

Closed KazariEX closed 2 months ago

FloEdelmann commented 2 months ago

Thanks! But can you please elaborate on the change? Where is useTemplateRef documented? Is it a native Vue feature?

KazariEX commented 2 months ago

It is a new feature of Vue 3.5 and there is no documentation yet.

https://github.com/vuejs/core/blob/main/packages/runtime-core/src/helpers/useTemplateRef.ts

FloEdelmann commented 2 months ago

FYI: Vue 3.5 with useTemplateRef was released two days ago: https://blog.vuejs.org/posts/vue-3-5#usetemplateref

s3xysteak commented 2 months ago

Now it is the most recommended way to use template ref https://vuejs.org/guide/essentials/template-refs.html#accessing-the-refs. Hope it can be merged soon 😄 .