Question · Vue.js course · Module 7: Props & Events

defineEmits and emit

How do you emit an event in <script setup>?

Answer options

  • const emit = defineEmits(['update']); emit('update')
  • this.$emit('update')
  • emit.send('update')
  • dispatch('update')

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