Complete the code to define a generic component that accepts a type prop.
<script setup>
const props = defineProps({
type: [1]
})
</script>In Vue, prop types are defined using the constructor like String, not lowercase or quoted strings.
Complete the code to emit a generic event named update from the component.
<script setup>
const emit = defineEmits([[1]])
</script>The generic event to emit for updates is usually called update.
Fix the error in the generic component slot usage by completing the blank.
<template>
<slot name=[1]></slot>
</template>Slot names must be strings in quotes, like "default".
Fill both blanks to define a generic component that accepts a prop and emits an event.
<script setup>
const props = defineProps({
value: [1]
})
const emit = defineEmits([[2]])
</script>The prop value is usually a String, and the event to emit for v-model is "update:modelValue".
Fill all three blanks to create a generic component that accepts a prop, emits an event, and uses a slot.
<script setup>
const props = defineProps({
label: [1]
})
const emit = defineEmits([[2]])
</script>
<template>
<button @click="emit([3])">{{ props.label }}</button>
<slot></slot>
</template>The prop label is a String. The event emitted is "click", and the emit call uses the event name "click".