VuVue · Lesson 1 of 7
Hello, Vue!
Vue's building block is the Single File Component (.vue file) — HTML, JavaScript, and CSS in one file, cleanly separated into three sections. It's the part that makes developers who've never used Vue say 'wait, that's actually nice.'
`<script setup>` is Vue 3's Composition API. The `setup` attribute is syntactic sugar — everything you declare at the top level is automatically available in the template. No need for `return {}` or wrapping in `setup()`.
◆ Note
Vue has two API styles: Composition API (`<script setup>`, modern, recommended) and Options API (`data()`, `methods:`, `computed:`, older style). Both work in Vue 3. This course uses Composition API — it's better for large components and TypeScript.
Vue has two API styles: Composition API (`<script setup>`, modern, recommended) and Options API (`data()`, `methods:`, `computed:`, older style). Both work in Vue 3. This course uses Composition API — it's better for large components and TypeScript.