Sometimes in a Vue Project, we may need direct access to the DOM elements in the template. A common usecase is that when we define expose (
defineExposes) to a component, the parent component needs to access that component to call the exposed functions or attributes. When I use Vue's template refs for the first time, I feel something strange.
⚠️ This post links to an external website. ⚠️
If this post was enjoyable or useful for you, please share it! If you have comments, questions, or feedback, you can email my personal email. To get new posts, subscribe use the RSS feed.