Challenge - 5 Problems
Vue SFC Master
Get all challenges correct to earn this badge!
Test your skills under time pressure!
❓ component_behavior
intermediate2:00remaining
What will this Vue SFC render?
Consider this Vue Single File Component (SFC). What will be displayed on the page when this component is used?
Vue
<template>
<div>
<h1>{{ title }}</h1>
<p>{{ message }}</p>
</div>
</template>
<script setup>
import { ref } from 'vue'
const title = 'Hello Vue'
const message = ref('Welcome to Single File Components')
</script>Attempts:
2 left
💡 Hint
Remember that {{ }} in the template shows the value of variables or refs.
✗ Incorrect
The template uses {{ title }} and {{ message }}. The title is a string, so it shows 'Hello Vue'. The message is a ref with value 'Welcome to Single File Components', so it shows that text.
📝 Syntax
intermediate1:30remaining
Which option correctly defines a reactive property in a Vue SFC?
In Vue 3 Single File Components using