Question · Vue.js course · Module 15: TypeScript & Nuxt

Generic defineEmits Syntax

Which syntax correctly defines typed emits in Vue 3.3+?

Answer options

  • defineEmits({ update: String })
  • defineEmits(type { update: string })
  • emits.define<{ update: string }>()
  • defineEmits<{ update: [value: string] }>()

You can check the correct answer by solving this task in the CodeWorlds game.