Complete the code to define a Vue component named 'HelloWorld'.
<script setup> import { defineComponent } from 'vue' export default [1]({ name: 'HelloWorld' }) </script>
The defineComponent function is used to define a Vue component in the Composition API.
Complete the code to use the 'HelloWorld' component inside the template.
<template>
<div>
<[1] />
</div>
</template>In Vue templates, component names are case-sensitive and usually PascalCase is used when imported as components.
Fix the error in the component registration by completing the code.
<script setup> import HelloWorld from './HelloWorld.vue' const app = [1]() app.component('HelloWorld', HelloWorld) app.mount('#app') </script>
The createApp function creates a Vue application instance where components can be registered.
Fill both blanks to create a reusable button component with a click event.
<template> <button @[1]="[2]">Click me</button> </template>
The @click directive listens for click events, and handleClick is the method called when clicked.
Fill all three blanks to pass a prop named 'title' and display it inside the component.
<template> <h1>[1]</h1> </template> <script setup> const props = defineProps({ [2]: String }) console.log(props.[3]) </script>
The prop name 'title' is used consistently in the template, props definition, and console log.