Complete the code to define a Vue Single File Component template section.
<template>
<div>[1]</div>
</template>The <template> section contains the HTML markup. Here, we want to display the text "Hello World" inside the div.
Complete the code to export the component's script section with a name.
<script setup> const name = '[1]' </script>
In Vue 3 Single File Components with script setup, you can define variables directly. Here, we set the component's name as "MyComponent".
Fix the error in the style section to apply scoped styles.
<style [1]>
div {
color: blue;
}
</style>Adding the scoped attribute to the style tag ensures styles apply only to this component.
Fill both blanks to define a reactive variable and display it in the template.
<template>
<p>{{ [1] }}</p>
</template>
<script setup>
import { ref } from 'vue'
const [2] = ref('Hello Vue')
</script>ref from VueThe reactive variable is named message. We display it in the template using {{ message }}.
Fill all three blanks to create a computed property and use it in the template.
<template>
<p>{{ [1] }}</p>
</template>
<script setup>
import { ref, computed } from 'vue'
const count = ref(0)
const [2] = computed(() => count.value [3] 1)
</script>The computed property is named incremented. It adds 1 to count.value. The template displays {{ incremented }}.