Build modern web applications with the Vue 3 Composition API. A complete guide covering the reactivity system, component communication, Pinia state management, and Nuxt.js integration.
Intermediate
Updated Oct 1, 2026
~3 min read
8 sections
6 code examples
Web IDE lab included
π
Vue Web IDE
Run code in the browser with nothing to install and learn through step-by-step examples.
Build modern web applications with the Vue 3 Composition API. A complete guide covering the reactivity system, component communication, Pinia state management, and Nuxt.js integration. Rather than listing concepts, this guide is organized so you can follow the content in the order you have to make decisions on a real project.
Key perspective
Frontend / app development
Do not stop at drawing the screen: look at state, data requests, routing, accessibility, and the unit of deployment together.
To make what you read stick, it helps to capture the flow as a picture first. The two diagrams below are reference maps you can keep coming back to while learning Vue.
Learning flow
Rendering diagramβ¦
Architecture view
Rendering diagramβ¦
Environment setup
When you first open Vue, the big picture matters more than individual commands. This section starts with the problems the concepts ahead were created to solve.
create-vue is the official scaffolding tool that sets up a Vite-based project structure interactively. If you need server-side rendering (SSR), people often start with Nuxt 3, which layers file-based routing and SSR on top of Vue, rather than configuring Vue directly.
Here you look at Composition API & reactivity alongside real code. Rather than copying the example as-is, read it with an eye on the inputs, the outputs, and the parts most likely to change.
Whenever a value wrapped in `ref` changes, only the parts of the screen that use that value are redrawn automatically. `computed` is a cached value recalculated only when the values it depends on change, and `watch` runs side effects (API calls, logging, and so on) at the moment a value changes.
Here you look at Component communication (Props/Emit) alongside real code. Rather than copying the example as-is, read it with an eye on the inputs, the outputs, and the parts most likely to change.
Vue components are built on a one-way data flow: data goes down from parent to child through props, and events go up from child to parent through emit. Because a child never changes the state of its parent directly, it is easy to trace where and why data changed.
<script setup>import { ref } from 'vue';const name = ref('');</script><template> <!-- v-model is shorthand for :modelValue + @update:modelValue --> <ChildInput v-model="name" /> <p>Input: {{ name }}</p></template>
Pinia state management
Here you look at Pinia state management alongside real code. Rather than copying the example as-is, read it with an eye on the inputs, the outputs, and the parts most likely to change.
Use Pinia when several components need to share the same state without passing through several levels of a props/emit chain. A store is a single centralized reactive object, with roles divided into state (data), getters (computed values), and actions (logic that changes state).
Here you look at Nuxt.js alongside real code. Rather than copying the example as-is, read it with an eye on the inputs, the outputs, and the parts most likely to change.
Nuxt 3 is the Next.js of Vue. It provides file-based routing, SSR, and auto imports.
pages/index.vueVUE
<script setup>const { data } = await useFetch('/api/posts');useSeoMeta({ title: 'My Blog', description: 'Blog powered by Nuxt 3',});</script><template> <div v-for="post in data" :key="post.id"> <NuxtLink :to="`/posts/${post.id}`">{{ post.title }}</NuxtLink> </div></template>
Vue practical design
Vue practical design is a point where the options diverge. Using the table to compare what each approach is for and how it differs in operation makes later decisions much easier.
In Vue, separating domain logic into composables with the Composition API improves reuse and testing.
Decision point
Question to ask
Practical guideline
Boundaries
Which parts of the Vue code are most likely to change?
Separate input/output, configuration, external integrations, and the core rules.
State
Where is state created and where does it go away?
Make the owner and lifecycle of state visible in the code.
Failure
What does the caller receive on failure?
Decide the timeout, fallback, and error contract first.
Vue operating standards
This section covers Vue operating standards from a practical perspective. Instead of memorizing the concept, focus on the situations in which you would reach for it.
Vue verification strategy is a point where the options diverge. Using the table to compare what each approach is for and how it differs in operation makes later decisions much easier.
Test component events, slots, form validation, and async loading states.
Quality axis
How to verify
Definition of done
Correctness
Automate the normal/failure cases.
The core scenarios pass reproducibly.
Regression prevention
When fixing a bug, leave the same case behind as a test.
The same failure is not deployed again.
Operability
Check the logs, metrics, and alerts.
There is a path for tracing the cause when a problem occurs.
Vue: frequently asked questions
Should I use the Options API or the Composition API?
For a new project, the Composition API is recommended. Related logic stays together, is easy to extract into functions for reuse, and works well with TypeScript. The Options API remains supported, so there is no need to rewrite existing code in a hurry.
When do I use ref and when reactive?
ref can wrap a value of any type and is accessed with .value in script. reactive works only with objects and loses reactivity when you destructure it or reassign the whole thing. Because it has fewer traps, defaulting to ref is widely recommended.
Should I use Vuex or Pinia?
New projects use Pinia. It is the official state management library for Vue, changes state without mutations so the code is shorter, and its TypeScript inference is good. Vuex remains for maintaining existing projects.