Kuis Custom Directives — Vue

Kuis materi Custom Directives di Vue — uji pemahamanmu dengan pertanyaan pilihan ganda, penjelasan jawaban, dan skor langsung. Main gratis di Hyper Sheets.

Pertanyaan di kuis ini

  1. Prefix apa yang digunakan untuk custom directive di Vue?
  2. Lengkapi custom directive untuk autofocus:
    const vFocus = {
    ___: (el) => el.focus()
    }
  3. Apa yang salah?
    <script setup>
    const focus = { mounted: (el) => el.focus() }
    </script>
    <template>
    <input v-focus />
    </template>