Put in order · Vue.js course · Module 2: Template Syntax
Template Ref Syntax
Arrange the template ref code pieces in the order they take effect:
Items to put in order
- inputRef.value.focus()
- <input ref="inputRef" />
- const inputRef = ref(null)
Show the answer
Correct order:
- const inputRef = ref(null)
- <input ref="inputRef" />
- inputRef.value.focus()