Ułóż w kolejności · Kurs Vue.js · Moduł 2: Składnia szablonów

Składnia template ref

Ułóż fragmenty kodu template ref w kolejności, w jakiej zaczynają działać:

Elementy do ułożenia

  • inputRef.value.focus()
  • <input ref="inputRef" />
  • const inputRef = ref(null)
Pokaż odpowiedź

Poprawna kolejność:

  1. const inputRef = ref(null)
  2. <input ref="inputRef" />
  3. inputRef.value.focus()