Complete the code to define a Vue component using the Composition API.
<script setup> import { ref } from 'vue' const count = ref(0) function increment() { count.value++ } </script> <template> <button @click=[1]>Clicked {{ count }} times</button> </template>
The @click event should call the increment function to increase the count.
Complete the code to import and register a component in Vue 3 with
<script setup> import [1] from './MyButton.vue' </script> <template> <[2] /> </template>
You import the component by its PascalCase name and use the same name in the template.
Fix the error in the component definition by completing the code.
<script setup> const message = 'Hello Vue!' </script> <template> <p>{{ [1] }}</p> </template>
this.message inside the template.The variable defined in script setup is message. Use it exactly in the template.
Fill both blanks to define a reactive property and display it in the template.
<script setup> import { [1] } from 'vue' const count = [2](0) </script> <template> <p>Count is: {{ count }}</p> </template>
reactive for a primitive value.ref from Vue.Use ref to create a reactive value and initialize it with 0.
Fill all three blanks to define a component with a prop and display it.
<script setup>
defineProps({
[1]: {
type: String,
required: true
}
})
</script>
<template>
<h1>{{ [2] }}</h1>
<p>{{ [3] }}</p>
</template>The prop is named title. Use title to display the heading and message for the paragraph.
