Click in order · Vue.js course · Module 15: TypeScript & Nuxt

v-model Pattern with Types

Arrange the steps for implementing a typed v-model in a component:

Items to click

  • emit('update:modelValue', newValue)
  • defineEmits<{ 'update:modelValue': [value: string] }>()
  • defineProps<{ modelValue: string }>()

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