Skip to content

Commit

Permalink
fix: initial value of template refs in Options API (#2587)
Browse files Browse the repository at this point in the history
  • Loading branch information
jay-es committed Dec 4, 2023
1 parent e88e878 commit 1350d08
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/guide/essentials/template-refs.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ export default {

</div>

Note that you can only access the ref **after the component is mounted.** If you try to access <span class="options-api">`$refs.input`</span><span class="composition-api">`input`</span> in a template expression, it will be `null` on the first render. This is because the element doesn't exist until after the first render!
Note that you can only access the ref **after the component is mounted.** If you try to access <span class="options-api">`$refs.input`</span><span class="composition-api">`input`</span> in a template expression, it will be <span class="options-api">`undefined`</span><span class="composition-api">`null`</span> on the first render. This is because the element doesn't exist until after the first render!

<div class="composition-api">

Expand Down

0 comments on commit 1350d08

Please sign in to comment.