
Lesson 01 · 10 min
One file: template, script, style
A Vue component is three blocks in one `.vue`. Markup stays markup.
Single File Component: <template> — HTML with directives, <script setup> — logic on the Composition API, <style scoped> — styles for this piece only. In the template you write tags, not a JSX function. It's closer to HTML than React, and closer to a component than "just a markup file".
scopedkeeps styles from leaking into another component.- A file named
HelloCard.vueis an ordinary component. You don't have to register it globally: import it where you insert it. {{ }}in a Vue template is text. An attribute:v-bind:titleor shortly:title.
Check
Lock it in before you move on
1. Why three blocks in a
.vue?2.
script setupgives the template3. Is a Vue template JSX?